diff options
-rw-r--r-- | cli/tools/test.rs | 6 | ||||
-rw-r--r-- | test_util/src/lib.rs | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/cli/tools/test.rs b/cli/tools/test.rs index 6ed443806..5395de6af 100644 --- a/cli/tools/test.rs +++ b/cli/tools/test.rs @@ -1623,9 +1623,9 @@ impl TestOutputPipe { // that it's done clearing out its pipe before returning. let (sender, receiver) = std::sync::mpsc::channel(); self.state.lock().replace(sender); - // Bit of a hack in order to send a zero width space in order - // to wake the thread up. It seems that sending zero bytes - // does not work here on windows. + // Bit of a hack to send a zero width space in order to wake + // the thread up. It seems that sending zero bytes here does + // not work on windows. self.writer.write_all(ZERO_WIDTH_SPACE.as_bytes()).unwrap(); self.writer.flush().unwrap(); receiver.recv().unwrap(); diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index 59a777d40..0eea21b04 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -1819,6 +1819,13 @@ impl<'a> CheckOutputIntegrationTest<'a> { actual = strip_ansi_codes(&actual).to_string(); + // deno test's output capturing flushes with a zero-width space in order to + // synchronize the output pipes. Occassionally this zero width space + // might end up in the output so strip it from the output comparison here. + if args.get(0) == Some(&"test") { + actual = actual.replace('\u{200B}', ""); + } + let expected = if let Some(s) = self.output_str { s.to_owned() } else { |