diff options
author | Ayato Tokubi <tokubi.ayato@gmail.com> | 2021-07-19 12:38:13 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-19 05:38:13 -0700 |
commit | af4912ed0d1c679716c7776610a6b7eb4c806f85 (patch) | |
tree | c3ea0438060a0759064c3b0a0453614d25921565 /cli/tests/integration/repl_tests.rs | |
parent | 7b82ef9dedb25f2e9b17a696c1c6aa7d6acdae63 (diff) |
fix(repl): output error without hanging when input is invalid (#11426)
Diffstat (limited to 'cli/tests/integration/repl_tests.rs')
-rw-r--r-- | cli/tests/integration/repl_tests.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cli/tests/integration/repl_tests.rs b/cli/tests/integration/repl_tests.rs index bfb849ed6..955c27069 100644 --- a/cli/tests/integration/repl_tests.rs +++ b/cli/tests/integration/repl_tests.rs @@ -73,6 +73,23 @@ fn pty_bad_input() { #[cfg(unix)] #[test] +fn pty_syntax_error_input() { + use std::io::{Read, Write}; + run_pty_test(|master| { + master.write_all(b"('\\u')\n").unwrap(); + master.write_all(b"('\n").unwrap(); + master.write_all(b"close();\n").unwrap(); + + let mut output = String::new(); + master.read_to_string(&mut output).unwrap(); + + assert!(output.contains("Unterminated string constant")); + assert!(output.contains("Unexpected eof")); + }); +} + +#[cfg(unix)] +#[test] fn pty_complete_symbol() { use std::io::{Read, Write}; run_pty_test(|master| { |