mirror of
https://github.com/denoland/deno.git
synced 2024-12-24 08:09:08 -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:
parent
659d1dd7f8
commit
e2853a955c
2 changed files with 8 additions and 8 deletions
|
@ -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]
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue