mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
fix(repl): Complete declarations (#10963)
This commit is contained in:
parent
4cbc4a7eb3
commit
b4026dac9c
2 changed files with 117 additions and 51 deletions
|
@ -2085,6 +2085,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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue