summaryrefslogtreecommitdiff
path: root/cli/tests/integration/install_tests.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-06-10 11:09:45 -0400
committerGitHub <noreply@github.com>2023-06-10 11:09:45 -0400
commit7f15126f23d97f20a4fb33e43136cd4d13825863 (patch)
tree85d77389969b31999680059e65954a9fa863758e /cli/tests/integration/install_tests.rs
parentf3326eebd6af2aaca1543e8cb543a7b16762bc96 (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/install_tests.rs')
-rw-r--r--cli/tests/integration/install_tests.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/tests/integration/install_tests.rs b/cli/tests/integration/install_tests.rs
index af4edd2ee..0756d460c 100644
--- a/cli/tests/integration/install_tests.rs
+++ b/cli/tests/integration/install_tests.rs
@@ -11,7 +11,7 @@ use test_util::TempDir;
fn install_basic() {
let _guard = util::http_server();
let temp_dir = TempDir::new();
- let temp_dir_str = temp_dir.path().to_string_lossy().to_string();
+ let temp_dir_str = temp_dir.path().to_string();
// ensure a lockfile doesn't get created or updated locally
temp_dir.write("deno.json", "{}");
@@ -44,7 +44,7 @@ fn install_basic() {
file_path = file_path.with_extension("cmd");
}
- let content = fs::read_to_string(&file_path).unwrap();
+ let content = file_path.read_to_string();
// ensure there's a trailing newline so the shell script can be
// more versatile.
assert_eq!(content.chars().last().unwrap(), '\n');
@@ -87,7 +87,7 @@ fn install_basic() {
fn install_custom_dir_env_var() {
let _guard = util::http_server();
let temp_dir = TempDir::new();
- let temp_dir_str = temp_dir.path().to_string_lossy().to_string();
+ let temp_dir_str = temp_dir.path().to_string();
let status = util::deno_cmd()
.current_dir(util::root_path()) // different cwd
@@ -205,7 +205,7 @@ fn installer_test_remote_module_run() {
fn check_local_by_default() {
let _guard = util::http_server();
let temp_dir = TempDir::new();
- let temp_dir_str = temp_dir.path().to_string_lossy().to_string();
+ let temp_dir_str = temp_dir.path().to_string();
let status = util::deno_cmd()
.current_dir(temp_dir.path())
@@ -225,7 +225,7 @@ fn check_local_by_default() {
fn check_local_by_default2() {
let _guard = util::http_server();
let temp_dir = TempDir::new();
- let temp_dir_str = temp_dir.path().to_string_lossy().to_string();
+ let temp_dir_str = temp_dir.path().to_string();
let status = util::deno_cmd()
.current_dir(temp_dir.path())