diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2021-06-15 09:31:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-15 09:31:36 -0400 |
commit | b4026dac9c4fb2b6cfc4a7015b4bacd102e06d08 (patch) | |
tree | 6c092c667d0bb25c07bbaff7e0bc521288bbc9ab /cli/tests/integration_tests.rs | |
parent | 4cbc4a7eb321ae2808cf3dce9428f45aaed0e338 (diff) |
fix(repl): Complete declarations (#10963)
Diffstat (limited to 'cli/tests/integration_tests.rs')
-rw-r--r-- | cli/tests/integration_tests.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index ede2b5542..c50d80323 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -2087,6 +2087,35 @@ mod integration { #[cfg(unix)] #[test] + fn pty_complete_declarations() { + use std::io::Read; + use util::pty::fork::*; + let deno_exe = util::deno_exe_path(); + let fork = Fork::from_ptmx().unwrap(); + if let Ok(mut master) = fork.is_parent() { + master.write_all(b"class MyClass {}\n").unwrap(); + master.write_all(b"My\t\n").unwrap(); + master.write_all(b"let myVar;\n").unwrap(); + master.write_all(b"myV\t\n").unwrap(); + master.write_all(b"close();\n").unwrap(); + + let mut output = String::new(); + master.read_to_string(&mut output).unwrap(); + + assert!(output.contains("> MyClass")); + assert!(output.contains("> myVar")); + + fork.wait().unwrap(); + } else { + std::env::set_var("NO_COLOR", "1"); + let err = exec::Command::new(deno_exe).arg("repl").exec(); + println!("err {}", err); + unreachable!() + } + } + + #[cfg(unix)] + #[test] fn pty_ignore_symbols() { use std::io::Read; use util::pty::fork::*; |