summaryrefslogtreecommitdiff
path: root/cli/util/fs.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 /cli/util/fs.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 'cli/util/fs.rs')
-rw-r--r--cli/util/fs.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/util/fs.rs b/cli/util/fs.rs
index 8167fd2e5..7cfd0ced7 100644
--- a/cli/util/fs.rs
+++ b/cli/util/fs.rs
@@ -672,12 +672,12 @@ 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);
}
#[test]