summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration_tests.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index c88c59587..651ffa110 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -3063,3 +3063,23 @@ fn exec_path() {
let expected = std::fs::canonicalize(util::deno_exe_path()).unwrap();
assert_eq!(expected, actual);
}
+
+#[cfg(not(windows))]
+#[test]
+fn set_raw_should_not_panic_on_no_tty() {
+ let output = util::deno_cmd()
+ .arg("eval")
+ .arg("--unstable")
+ .arg("Deno.setRaw(Deno.stdin.rid, true)")
+ // stdin set to piped so it certainly does not refer to TTY
+ .stdin(std::process::Stdio::piped())
+ // stderr is piped so we can capture output.
+ .stderr(std::process::Stdio::piped())
+ .spawn()
+ .unwrap()
+ .wait_with_output()
+ .unwrap();
+ assert!(!output.status.success());
+ let stderr = std::str::from_utf8(&output.stderr).unwrap().trim();
+ assert!(stderr.contains("BadResource"));
+}