diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-04-22 17:49:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 17:49:10 -0400 |
commit | 4cc5b2126a8a5aca42ad37d8d385635411f40f78 (patch) | |
tree | d08e7529abdcb7467a305960ff0fbe6e288976d9 /cli/tests/integration/repl_tests.rs | |
parent | 1ad8c11bc97d208208fb6a59f8797ca5a198dffd (diff) |
chore(tests): fix pty_clear_function on Windows (#14364)
Diffstat (limited to 'cli/tests/integration/repl_tests.rs')
-rw-r--r-- | cli/tests/integration/repl_tests.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/cli/tests/integration/repl_tests.rs b/cli/tests/integration/repl_tests.rs index 05a17d4b7..0fca59473 100644 --- a/cli/tests/integration/repl_tests.rs +++ b/cli/tests/integration/repl_tests.rs @@ -767,15 +767,22 @@ fn pty_clear_function() { util::with_pty(&["repl"], |mut console| { console.write_line("console.log('hello');"); 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("close();"); let output = console.read_all_output(); - assert!(output.contains("hello")); - assert!(output.contains("[1;1H")); + if cfg!(windows) { + // 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("const clear = 1 + 2;")); - assert!(output.contains('3')); + assert!(output.contains("const clear = 1234 + 2000;")); + assert!(output.contains("3234")); }); } |