diff options
author | Yazan AbdAl-Rahman <yazan.abdalrahman@exalt.ps> | 2024-09-18 16:51:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-18 14:51:39 +0100 |
commit | bed46474b2d59b229bd85dbdec5b3d943c32f60f (patch) | |
tree | 8262166530242f7c1b68de17e97c646912f1b939 /tests | |
parent | 48ea4e3c92b53936e89101a56a013300a47337d3 (diff) |
fix: do not panic running invalid file specifier (#25530)
Co-authored-by: Bedis Nbiba <bedisnbiba@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/run_tests.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index b47af238b..50f0f58f8 100644 --- a/tests/integration/run_tests.rs +++ b/tests/integration/run_tests.rs @@ -5125,3 +5125,27 @@ fn emit_failed_readonly_file_system() { .run(); output.assert_matches_text("[WILDCARD]Error saving emit data ([WILDLINE]main.ts)[WILDCARD]Skipped emit cache save of [WILDLINE]other.ts[WILDCARD]hi[WILDCARD]"); } + +#[cfg(windows)] +#[test] +fn handle_invalid_path_error() { + let deno_cmd = util::deno_cmd_with_deno_dir(&util::new_deno_dir()); + let output = deno_cmd.arg("run").arg("file://asdf").output().unwrap(); + assert!( + String::from_utf8_lossy(&output.stderr).contains("Invalid file path.") + ); + + let deno_cmd = util::deno_cmd_with_deno_dir(&util::new_deno_dir()); + let output = deno_cmd.arg("run").arg("/a/b").output().unwrap(); + assert!(String::from_utf8_lossy(&output.stderr).contains("Module not found")); + + let deno_cmd = util::deno_cmd_with_deno_dir(&util::new_deno_dir()); + let output = deno_cmd.arg("run").arg("//a/b").output().unwrap(); + assert!( + String::from_utf8_lossy(&output.stderr).contains("Invalid file path.") + ); + + let deno_cmd = util::deno_cmd_with_deno_dir(&util::new_deno_dir()); + let output = deno_cmd.arg("run").arg("///a/b").output().unwrap(); + assert!(String::from_utf8_lossy(&output.stderr).contains("Module not found")); +} |