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:
David Sherret 2023-06-10 11:09:45 -04:00 committed by GitHub
parent f3326eebd6
commit 7f15126f23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 778 additions and 719 deletions

View file

@ -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]