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/tests/integration/repl_tests.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/tests/integration/repl_tests.rs')
-rw-r--r-- | cli/tests/integration/repl_tests.rs | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/cli/tests/integration/repl_tests.rs b/cli/tests/integration/repl_tests.rs index 77a534d2e..c25a151a1 100644 --- a/cli/tests/integration/repl_tests.rs +++ b/cli/tests/integration/repl_tests.rs @@ -316,7 +316,15 @@ fn repl_cwd() { .args_vec(["repl", "-A"]) .with_pty(|mut console| { console.write_line("Deno.cwd()"); - console.expect(temp_dir.path().file_name().unwrap().to_str().unwrap()); + console.expect( + temp_dir + .path() + .as_path() + .file_name() + .unwrap() + .to_str() + .unwrap(), + ); }); } @@ -535,10 +543,7 @@ fn missing_deno_dir() { "repl", Some(vec!["1"]), Some(vec![ - ( - "DENO_DIR".to_owned(), - deno_dir_path.to_str().unwrap().to_owned(), - ), + ("DENO_DIR".to_owned(), deno_dir_path.to_string()), ("NO_COLOR".to_owned(), "1".to_owned()), ]), false, @@ -558,10 +563,7 @@ fn custom_history_path() { "repl", Some(vec!["1"]), Some(vec![ - ( - "DENO_REPL_HISTORY".to_owned(), - history_path.to_str().unwrap().to_owned(), - ), + ("DENO_REPL_HISTORY".to_owned(), history_path.to_string()), ("NO_COLOR".to_owned(), "1".to_owned()), ]), false, @@ -580,10 +582,7 @@ fn disable_history_file() { "repl", Some(vec!["1"]), Some(vec![ - ( - "DENO_DIR".to_owned(), - deno_dir.path().to_str().unwrap().to_owned(), - ), + ("DENO_DIR".to_owned(), deno_dir.path().to_string()), ("DENO_REPL_HISTORY".to_owned(), "".to_owned()), ("NO_COLOR".to_owned(), "1".to_owned()), ]), @@ -877,10 +876,7 @@ fn npm_packages() { let mut env_vars = util::env_vars_for_npm_tests(); env_vars.push(("NO_COLOR".to_owned(), "1".to_owned())); let temp_dir = TempDir::new(); - env_vars.push(( - "DENO_DIR".to_string(), - temp_dir.path().to_string_lossy().to_string(), - )); + env_vars.push(("DENO_DIR".to_string(), temp_dir.path().to_string())); { let (out, err) = util::run_and_collect_output_with_args( |