diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-05-06 15:51:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-06 15:51:33 -0400 |
commit | 221221cc9758225a85ecebb2de206591abf16e68 (patch) | |
tree | e050bc8601d1ab2b6c6a7a44fbeaa0ce40868685 /cli/tests/integration_tests.rs | |
parent | 76c77bb32c642283e61c9a6bb4936401fc43eaba (diff) |
BREAKING: execPath should require allow-read (#5109)
Diffstat (limited to 'cli/tests/integration_tests.rs')
-rw-r--r-- | cli/tests/integration_tests.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index dec3fe8ee..9a35ba300 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -2421,6 +2421,27 @@ async fn inspector_does_not_hang() { assert!(child.wait().unwrap().success()); } +#[test] +fn exec_path() { + let output = util::deno_cmd() + .current_dir(util::root_path()) + .arg("run") + .arg("--allow-read") + .arg("cli/tests/exec_path.ts") + .stdout(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + assert!(output.status.success()); + let stdout_str = std::str::from_utf8(&output.stdout).unwrap().trim(); + let actual = + std::fs::canonicalize(&std::path::Path::new(stdout_str)).unwrap(); + let expected = + std::fs::canonicalize(deno::test_util::deno_exe_path()).unwrap(); + assert_eq!(expected, actual); +} + mod util { use deno::colors::strip_ansi_codes; pub use deno::test_util::*; |