mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +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
|
@ -519,13 +519,13 @@ mod tests {
|
|||
source_fixtures: &[(&str, &str)],
|
||||
location: &Path,
|
||||
) -> Documents {
|
||||
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");
|
||||
documents.open(specifier, *version, *language_id, (*source).into());
|
||||
}
|
||||
let http_cache = HttpCache::new(location);
|
||||
let http_cache = HttpCache::new(location.to_path_buf());
|
||||
for (specifier, source) in source_fixtures {
|
||||
let specifier =
|
||||
resolve_url(specifier).expect("failed to create specifier");
|
||||
|
@ -546,7 +546,7 @@ mod tests {
|
|||
sources: &[(&str, &str)],
|
||||
) -> Documents {
|
||||
let location = temp_dir.path().join("deps");
|
||||
mock_documents(documents, sources, &location)
|
||||
mock_documents(documents, sources, location.as_path())
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue