diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-06-10 11:09:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-10 11:09:45 -0400 |
commit | 7f15126f23d97f20a4fb33e43136cd4d13825863 (patch) | |
tree | 85d77389969b31999680059e65954a9fa863758e /cli/args/mod.rs | |
parent | f3326eebd6af2aaca1543e8cb543a7b16762bc96 (diff) |
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.
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r-- | cli/args/mod.rs | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs index d740b9ab0..98e8f3564 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1582,9 +1582,10 @@ mod test { temp_dir.write("pages/[id].ts", ""); + let temp_dir_path = temp_dir.path().as_path(); let error = resolve_files( Some(FilesConfig { - include: vec![temp_dir.path().join("data/**********.ts")], + include: vec![temp_dir_path.join("data/**********.ts")], exclude: vec![], }), None, @@ -1595,12 +1596,12 @@ mod test { let resolved_files = resolve_files( Some(FilesConfig { include: vec![ - temp_dir.path().join("data/test1.?s"), - temp_dir.path().join("nested/foo/*.ts"), - temp_dir.path().join("nested/fizz/*.ts"), - temp_dir.path().join("pages/[id].ts"), + temp_dir_path.join("data/test1.?s"), + temp_dir_path.join("nested/foo/*.ts"), + temp_dir_path.join("nested/fizz/*.ts"), + temp_dir_path.join("pages/[id].ts"), ], - exclude: vec![temp_dir.path().join("nested/**/*bazz.ts")], + exclude: vec![temp_dir_path.join("nested/**/*bazz.ts")], }), None, ) @@ -1609,24 +1610,24 @@ mod test { assert_eq!( resolved_files.include, vec![ - temp_dir.path().join("data/test1.js"), - temp_dir.path().join("data/test1.ts"), - temp_dir.path().join("nested/foo/bar.ts"), - temp_dir.path().join("nested/foo/bazz.ts"), - temp_dir.path().join("nested/foo/fizz.ts"), - temp_dir.path().join("nested/foo/foo.ts"), - temp_dir.path().join("nested/fizz/bar.ts"), - temp_dir.path().join("nested/fizz/bazz.ts"), - temp_dir.path().join("nested/fizz/fizz.ts"), - temp_dir.path().join("nested/fizz/foo.ts"), - temp_dir.path().join("pages/[id].ts"), + temp_dir_path.join("data/test1.js"), + temp_dir_path.join("data/test1.ts"), + temp_dir_path.join("nested/foo/bar.ts"), + temp_dir_path.join("nested/foo/bazz.ts"), + temp_dir_path.join("nested/foo/fizz.ts"), + temp_dir_path.join("nested/foo/foo.ts"), + temp_dir_path.join("nested/fizz/bar.ts"), + temp_dir_path.join("nested/fizz/bazz.ts"), + temp_dir_path.join("nested/fizz/fizz.ts"), + temp_dir_path.join("nested/fizz/foo.ts"), + temp_dir_path.join("pages/[id].ts"), ] ); assert_eq!( resolved_files.exclude, vec![ - temp_dir.path().join("nested/fizz/bazz.ts"), - temp_dir.path().join("nested/foo/bazz.ts"), + temp_dir_path.join("nested/fizz/bazz.ts"), + temp_dir_path.join("nested/foo/bazz.ts"), ] ) } |