1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

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>
This commit is contained in:
Elijah 2023-04-12 16:45:53 -07:00 committed by Levente Kurusa
parent 0b023538a0
commit 154920a24e
No known key found for this signature in database
GPG key ID: 9F72F3C05BA137C4
2 changed files with 8 additions and 8 deletions

View file

@ -672,12 +672,12 @@ mod tests {
} }
} }
// TODO: Get a good expected value here for Windows.
#[cfg(not(windows))]
#[test] #[test]
fn resolve_from_cwd_absolute() { fn resolve_from_cwd_absolute() {
let expected = Path::new("/a"); let expected = Path::new("a");
assert_eq!(resolve_from_cwd(expected).unwrap(), expected); let cwd = current_dir().unwrap();
let absolute_expected = cwd.join(expected);
assert_eq!(resolve_from_cwd(expected).unwrap(), absolute_expected);
} }
#[test] #[test]

View file

@ -72,11 +72,11 @@ mod tests {
} }
} }
// TODO: Get a good expected value here for Windows.
#[cfg(not(windows))]
#[test] #[test]
fn resolve_from_cwd_absolute() { fn resolve_from_cwd_absolute() {
let expected = Path::new("/a"); let expected = Path::new("a");
assert_eq!(resolve_from_cwd(expected).unwrap(), expected); let cwd = current_dir().unwrap();
let absolute_expected = cwd.join(expected);
assert_eq!(resolve_from_cwd(expected).unwrap(), absolute_expected);
} }
} }