Commit b8af7ac

Barrett Ruth  ·  2026-10-20 21:43:10 -0400 EDT
parent bf2f1f2
test: don't use realpath in the dangling symlink test (#281)
1 files changed,  +5, -1
▶ M src/cfg.zig
+5, -1
jump to top
......@@ -146,7 +146,11 @@ test "mkdirAll fails on dangling symlink instead of looping" {
146146 defer tmp.cleanup();
147147
148148 const alloc = std.testing.allocator;
149- const tmp_path = try tmp.dir.realPathFileAlloc(std.testing.io, ".", alloc);
149+ // Dir.realPathFile is unsupported on OpenBSD, so build the absolute path
150+ // from the cwd instead.
151+ const cwd_path = try std.process.currentPathAlloc(std.testing.io, alloc);
152+ defer alloc.free(cwd_path);
153+ const tmp_path = try std.fs.path.join(alloc, &.{ cwd_path, ".zig-cache", "tmp", &tmp.sub_path });
150154 defer alloc.free(tmp_path);
151155
152156 try tmp.dir.symLink(std.testing.io, "nonexistent", "broken_link", .{});