diff options
Diffstat (limited to 'cli/tests/integration/install_tests.rs')
-rw-r--r-- | cli/tests/integration/install_tests.rs | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/cli/tests/integration/install_tests.rs b/cli/tests/integration/install_tests.rs index 60bfaf50e..2db32bd28 100644 --- a/cli/tests/integration/install_tests.rs +++ b/cli/tests/integration/install_tests.rs @@ -3,6 +3,8 @@ use std::fs; use std::process::Command; use test_util as util; +use test_util::assert_contains; +use test_util::assert_ends_with; use test_util::TempDir; #[test] @@ -42,11 +44,12 @@ fn install_basic() { assert_eq!(content.chars().last().unwrap(), '\n'); if cfg!(windows) { - assert!( - content.contains(r#""run" "--check" "http://localhost:4545/echo.ts""#) + assert_contains!( + content, + r#""run" "--check" "http://localhost:4545/echo.ts""# ); } else { - assert!(content.contains(r#"run --check 'http://localhost:4545/echo.ts'"#)); + assert_contains!(content, r#"run --check 'http://localhost:4545/echo.ts'"#); } } @@ -83,11 +86,12 @@ fn install_custom_dir_env_var() { let content = fs::read_to_string(file_path).unwrap(); if cfg!(windows) { - assert!( - content.contains(r#""run" "--check" "http://localhost:4545/echo.ts""#) + assert_contains!( + content, + r#""run" "--check" "http://localhost:4545/echo.ts""# ); } else { - assert!(content.contains(r#"run --check 'http://localhost:4545/echo.ts'"#)); + assert_contains!(content, r#"run --check 'http://localhost:4545/echo.ts'"#); } } @@ -124,7 +128,7 @@ fn installer_test_local_module_run() { .output() .unwrap(); let stdout_str = std::str::from_utf8(&output.stdout).unwrap().trim(); - assert!(stdout_str.ends_with("hello, foo")); + assert_ends_with!(stdout_str, "hello, foo"); } #[test] @@ -158,10 +162,10 @@ fn installer_test_remote_module_run() { .env("PATH", util::target_dir()) .output() .unwrap(); - assert!(std::str::from_utf8(&output.stdout) - .unwrap() - .trim() - .ends_with("hello, foo")); + assert_ends_with!( + std::str::from_utf8(&output.stdout).unwrap().trim(), + "hello, foo", + ); } #[test] |