mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -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
0b023538a0
commit
154920a24e
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