mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
chore(tests): fix pty_clear_function on Windows (#14364)
This commit is contained in:
parent
1ad8c11bc9
commit
4cc5b2126a
1 changed files with 12 additions and 5 deletions
|
@ -767,15 +767,22 @@ fn pty_clear_function() {
|
||||||
util::with_pty(&["repl"], |mut console| {
|
util::with_pty(&["repl"], |mut console| {
|
||||||
console.write_line("console.log('hello');");
|
console.write_line("console.log('hello');");
|
||||||
console.write_line("clear();");
|
console.write_line("clear();");
|
||||||
console.write_line("const clear = 1 + 2;");
|
console.write_line("const clear = 1234 + 2000;");
|
||||||
console.write_line("clear;");
|
console.write_line("clear;");
|
||||||
console.write_line("close();");
|
console.write_line("close();");
|
||||||
|
|
||||||
let output = console.read_all_output();
|
let output = console.read_all_output();
|
||||||
assert!(output.contains("hello"));
|
if cfg!(windows) {
|
||||||
assert!(output.contains("[1;1H"));
|
// Windows will overwrite what's in the console buffer before
|
||||||
|
// we read from it. It contains this string repeated many times
|
||||||
|
// to clear the screen.
|
||||||
|
assert!(output.contains("\r\n\u{1b}[K\r\n\u{1b}[K\r\n\u{1b}[K"));
|
||||||
|
} else {
|
||||||
|
assert!(output.contains("hello"));
|
||||||
|
assert!(output.contains("[1;1H"));
|
||||||
|
}
|
||||||
assert!(output.contains("undefined"));
|
assert!(output.contains("undefined"));
|
||||||
assert!(output.contains("const clear = 1 + 2;"));
|
assert!(output.contains("const clear = 1234 + 2000;"));
|
||||||
assert!(output.contains('3'));
|
assert!(output.contains("3234"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue