mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
chore(tests): test_util - Add PathRef
(#19450)
This adds a new `PathRef` struct to test_util for making it easier to work with paths in test code. I'm going to expand on this more in the future.
This commit is contained in:
parent
f3326eebd6
commit
7f15126f23
40 changed files with 778 additions and 719 deletions
|
@ -1198,7 +1198,7 @@ mod tests {
|
|||
location: &Path,
|
||||
maybe_import_map: Option<(&str, &str)>,
|
||||
) -> StateSnapshot {
|
||||
let mut documents = Documents::new(location);
|
||||
let mut documents = Documents::new(location.to_path_buf());
|
||||
for (specifier, source, version, language_id) in fixtures {
|
||||
let specifier =
|
||||
resolve_url(specifier).expect("failed to create specifier");
|
||||
|
@ -1243,7 +1243,7 @@ mod tests {
|
|||
sources: &[(&str, &str, i32, LanguageId)],
|
||||
maybe_import_map: Option<(&str, &str)>,
|
||||
) -> (StateSnapshot, PathBuf) {
|
||||
let location = temp_dir.path().join("deps");
|
||||
let location = temp_dir.path().join("deps").to_path_buf();
|
||||
let state_snapshot =
|
||||
mock_state_snapshot(sources, &location, maybe_import_map);
|
||||
(state_snapshot, location)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue