authorgravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2021-05-06 12:53:48-04:00
committergravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2021-05-07 01:04:38-04:00
log84d5cc31c560749eda1e36b7bc9e6cf542eee550
tree659b06af179ec357c6d7030fafcc0488583dfc08
parent530e67cb868fbd24900d48eee891efa1aa135096

fix test to restore cwd after chdir

- `../zig-cache/tmp` is no longer created by subsequent test(s)

1 files changed, 2 insertions(+), 0 deletions(-)

lib/std/os/test.zig+2
......@@ -43,6 +43,8 @@ test "chdir smoke test" {
4343 // Next, change current working directory to one level above
4444 const parent = fs.path.dirname(old_cwd) orelse unreachable; // old_cwd should be absolute
4545 try os.chdir(parent);
46 // Restore cwd because process may have other tests that do not tolerate chdir.
47 defer os.chdir(old_cwd) catch unreachable;
4648 var new_cwd_buf: [fs.MAX_PATH_BYTES]u8 = undefined;
4749 const new_cwd = try os.getcwd(new_cwd_buf[0..]);
4850 expect(mem.eql(u8, parent, new_cwd));