summaryrefslogtreecommitdiff
path: root/cli/tests/integration_tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/integration_tests.rs')
-rw-r--r--cli/tests/integration_tests.rs59
1 files changed, 59 insertions, 0 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index 87a6f9d63..2ec25d0d0 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -3116,3 +3116,62 @@ fn set_raw_should_not_panic_on_no_tty() {
let stderr = std::str::from_utf8(&output.stderr).unwrap().trim();
assert!(stderr.contains("BadResource"));
}
+
+#[cfg(windows)]
+enum WinProcConstraints {
+ NoStdIn,
+ NoStdOut,
+ NoStdErr,
+}
+
+#[cfg(windows)]
+fn run_deno_script_constrained(
+ script_path: std::path::PathBuf,
+ constraints: WinProcConstraints,
+) -> Result<(), i64> {
+ let file_path = "cli/tests/DenoWinRunner.ps1";
+ let constraints = match constraints {
+ WinProcConstraints::NoStdIn => "1",
+ WinProcConstraints::NoStdOut => "2",
+ WinProcConstraints::NoStdErr => "4",
+ };
+ let deno_exe_path = util::deno_exe_path()
+ .into_os_string()
+ .into_string()
+ .unwrap();
+
+ let deno_script_path = script_path.into_os_string().into_string().unwrap();
+
+ let args = vec![&deno_exe_path[..], &deno_script_path[..], constraints];
+ util::run_powershell_script_file(file_path, args)
+}
+
+#[cfg(windows)]
+#[test]
+fn should_not_panic_on_no_stdin() {
+ let output = run_deno_script_constrained(
+ util::tests_path().join("echo.ts"),
+ WinProcConstraints::NoStdIn,
+ );
+ output.unwrap();
+}
+
+#[cfg(windows)]
+#[test]
+fn should_not_panic_on_no_stdout() {
+ let output = run_deno_script_constrained(
+ util::tests_path().join("echo.ts"),
+ WinProcConstraints::NoStdOut,
+ );
+ output.unwrap();
+}
+
+#[cfg(windows)]
+#[test]
+fn should_not_panic_on_no_stderr() {
+ let output = run_deno_script_constrained(
+ util::tests_path().join("echo.ts"),
+ WinProcConstraints::NoStdErr,
+ );
+ output.unwrap();
+}