diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-11-15 23:25:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 10:25:52 +1100 |
commit | cd9193f126c229f3457ada1cf9a05897fdebb77d (patch) | |
tree | 070342089d3a40300f49ba254afd43994ac2a377 /cli/tests/integration/run_tests.rs | |
parent | 243d3ba755265dc2cdc5cd0aaffdf9da57d7a931 (diff) |
fix(cli): short-circuit in prepare_module_load() (#12604)
Diffstat (limited to 'cli/tests/integration/run_tests.rs')
-rw-r--r-- | cli/tests/integration/run_tests.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 214eb8ece..2d96fab8f 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -2271,3 +2271,37 @@ fn issue12453() { .unwrap(); assert!(status.success()); } + +/// Regression test for https://github.com/denoland/deno/issues/12740. +#[test] +fn issue12740() { + let mod_dir = TempDir::new().expect("tempdir fail"); + let mod1_path = mod_dir.path().join("mod1.ts"); + let mod2_path = mod_dir.path().join("mod2.ts"); + let mut deno_cmd = util::deno_cmd(); + std::fs::write(&mod1_path, "").unwrap(); + let status = deno_cmd + .current_dir(util::testdata_path()) + .arg("run") + .arg(&mod1_path) + .stderr(std::process::Stdio::null()) + .stdout(std::process::Stdio::null()) + .spawn() + .unwrap() + .wait() + .unwrap(); + assert!(status.success()); + std::fs::write(&mod1_path, "export { foo } from \"./mod2.ts\";").unwrap(); + std::fs::write(&mod2_path, "(").unwrap(); + let status = deno_cmd + .current_dir(util::testdata_path()) + .arg("run") + .arg(&mod1_path) + .stderr(std::process::Stdio::null()) + .stdout(std::process::Stdio::null()) + .spawn() + .unwrap() + .wait() + .unwrap(); + assert!(!status.success()); +} |