From e2853a955cf532491b4a4fbef669965cc2b44afe Mon Sep 17 00:00:00 2001 From: Elijah Date: Wed, 12 Apr 2023 16:45:53 -0700 Subject: 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 --- runtime/fs_util.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime') 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); } } -- cgit v1.2.3