summaryrefslogtreecommitdiff
path: root/runtime/fs_util.rs
diff options
context:
space:
mode:
authorElijah <business@elijahpepe.com>2023-04-12 16:45:53 -0700
committerGitHub <noreply@github.com>2023-04-13 01:45:53 +0200
commite2853a955cf532491b4a4fbef669965cc2b44afe (patch)
treea2a5215feec089bf997611c80f9d285efbacdf44 /runtime/fs_util.rs
parent659d1dd7f85663da51c6d557bf2265936d683361 (diff)
test(runtime): support Windows in resolve_from_cwd_absolute (#18379)
`current_dir().unwrap()` joined with a Path is equivalent to the implementation in `resolve_from_cwd()`. Manually tested on Ubuntu 22.04 and Windows 11. Signed-off-by: Elijah Conners <business@elijahpepe.com>
Diffstat (limited to 'runtime/fs_util.rs')
-rw-r--r--runtime/fs_util.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/fs_util.rs b/runtime/fs_util.rs
index 1a01a0e05..a29a57b39 100644
--- a/runtime/fs_util.rs
+++ b/runtime/fs_util.rs
@@ -72,11 +72,11 @@ mod tests {
}
}
- // TODO: Get a good expected value here for Windows.
- #[cfg(not(windows))]
#[test]
fn resolve_from_cwd_absolute() {
- let expected = Path::new("/a");
- assert_eq!(resolve_from_cwd(expected).unwrap(), expected);
+ let expected = Path::new("a");
+ let cwd = current_dir().unwrap();
+ let absolute_expected = cwd.join(expected);
+ assert_eq!(resolve_from_cwd(expected).unwrap(), absolute_expected);
}
}