File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,14 @@ test "chdir smoke test" {
6464
6565 var new_cwd_buf : [fs .MAX_PATH_BYTES ]u8 = undefined ;
6666 const new_cwd = try os .getcwd (new_cwd_buf [0.. ]);
67- try expect (mem .eql (u8 , tmp_dir_path , new_cwd ));
67+
68+ // On Windows, fs.path.resolve returns an uppercase drive letter, but the drive letter returned by getcwd may be lowercase
69+ var resolved_cwd_buf : [fs .MAX_PATH_BYTES ]u8 = undefined ;
70+ var resolved_cwd = path : {
71+ var allocator = std .heap .FixedBufferAllocator .init (& resolved_cwd_buf );
72+ break :path try fs .path .resolve (allocator .allocator (), &[_ ][]const u8 {new_cwd });
73+ };
74+ try expect (mem .eql (u8 , tmp_dir_path , resolved_cwd ));
6875
6976 // Restore cwd because process may have other tests that do not tolerate chdir.
7077 tmp_dir .close ();
You can’t perform that action at this time.
0 commit comments