Repository: brendanzab/codespan (rust)

Issue:
Display is broken on some platforms
Hi,

Yesterday I was playing with [Gleam](https://github.com/gleam-lang) and noticed that the errors displayed in my terminal (Cmder on Windows 10) are kinda broken.

It looks like this :
![image](https://user-images.githubusercontent.com/1208646/105060112-4b401b80-5a78-11eb-8382-749367191bd9.png)

I guess it would be hard to have something that works on all platforms if it uses "advanced characters" (especially  on Windows). I think, it would be easier to run correctly on all platforms if diags could be displayed using only ASCII characters (ie whose range are in 0-127). I see many possible solution. One could be using an enum to instantiate a ``Char`` struct in Legacy (only ASCII) or Standard mode (make advantage of UTF-8 and Unicode) . Another one could be using cfg expression for the default value where it would change based on the platform it is compiled for. The one thing I don't know how to solve is by what should be replacing the characters that are troublesome. Especially for corners, they are single character for now and there isn't a look alike character in pure ASCII. More than one character could be used then but it would offset alignment. 

For the record, rustc seems to be only using ASCII chars.

Pull request description:
rendering in US-ASCII only
Resolves #311.

Patch:
diff --git a/codespan-reporting/CHANGELOG.md b/codespan-reporting/CHANGELOG.md
index da91f22..9d1d32a 100644
--- a/codespan-reporting/CHANGELOG.md
+++ b/codespan-reporting/CHANGELOG.md
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 
+### Added
+
+-   The `ascii-only` feature changes the defaults so that rendering uses only ASCII characters
+    (not above U+007F) for use cases that do not allow for box drawing characters, e.g.
+    terminals that do not support them.
+
 ## [0.11.0] - 2020-11-30
 
 There is now a [code of conduct](https://github.com/brendanzab/codespan/blob/master/CODE_OF_CONDUCT.md)
diff --git a/codespan-reporting/Cargo.toml b/codespan-reporting/Cargo.toml
index 0a6f79e..208f08f 100644
--- a/codespan-reporting/Cargo.toml
+++ b/codespan-reporting/Cargo.toml
@@ -27,3 +27,4 @@ unindent = "0.1"
 
 [features]
 serialization = ["serde", "serde/rc"]
+ascii-only = []
diff --git a/codespan-reporting/src/term/config.rs b/codespan-reporting/src/term/config.rs
index 18cbd44..caebcd9 100644
--- a/codespan-reporting/src/term/config.rs
+++ b/codespan-reporting/src/term/config.rs
@@ -193,19 +193,20 @@ impl Default for Styles {
 }
 
 /// Characters to use when rendering the diagnostic.
+///
+/// By using the feature `ascii-only` you can switch the defaults to an
+/// ASCII-only format suitable for rendering on terminals that do not support
+/// box drawing characters.
 #[derive(Clone, Debug)]
 pub struct Chars {
-    /// The character to use for the top-left border of the source.
-    /// Defaults to: `'┌'`.
-    pub source_border_top_left: char,
-    /// The character to use for the top border of the source.
-    /// Defaults to: `'─'`.
-    pub source_border_top: char,
+    /// The characters to use for the top-left border of the snippet.
+    /// Defaults to: `"┌─"` or `"-->"` with `ascii-only` feature.
+    pub snippet_start: String,
     /// The character to use for the left border of the source.
-    /// Defaults to: `'│'`.
+    /// Defaults to: `'│'` or `'|'` with `ascii-only` feature.
     pub source_border_left: char,
     /// The character to use for the left border break of the source.
-    /// Defaults to: `'·'`.
+    /// Defaults to: `'·'` or `'.'` with `ascii-only` feature.
     pub source_border_left_break: char,
 
     /// The character to use for the note bullet.
@@ -232,31 +233,46 @@ pub struct Chars {
     /// Defaults to: `'\''`.
     pub multi_secondary_caret_end: char,
     /// The character to use for the top-left corner of a multi-line label.
-    /// Defaults to: `'╭'`.
+    /// Defaults to: `'╭'` or `'/'` with `ascii-only` feature.
     pub multi_top_left: char,
     /// The character to use for the top of a multi-line label.
-    /// Defaults to: `'─'`.
+    /// Defaults to: `'─'` or `'-'` with `ascii-only` feature.
     pub multi_top: char,
     /// The character to use for the bottom-left corner of a multi-line label.
-    /// Defaults to: `'╰'`.
+    /// Defaults to: `'╰'` or `'\\'` with `ascii-only` feature.
     pub multi_bottom_left: char,
     /// The character to use when marking the bottom of a multi-line label.
-    /// Defaults to: `'─'`.
+    /// Defaults to: `'─'` or `'-'` with `ascii-only` feature.
     pub multi_bottom: char,
     /// The character to use for the left of a multi-line label.
-    /// Defaults to: `'│'`.
+    /// Defaults to: `'│'` or `'|'` with `ascii-only` feature.
     pub multi_left: char,
 
     /// The character to use for the left of a pointer underneath a caret.
-    /// Defaults to: `'│'`.
+    /// Defaults to: `'│'` or `'|'` with `ascii-only` feature.
     pub pointer_left: char,
 }
 
 impl Default for Chars {
+    #[cfg(not(feature = "ascii-only"))]
     fn default() -> Chars {
+        Chars::box_drawing()
+    }
+
+    #[cfg(feature = "ascii-only")]
+    fn default() -> Chars {
+        Chars::ascii()
+    }
+}
+
+impl Chars {
+    /// A character set that uses Unicode box drawing characters.
+    ///
+    /// This might not be compatible with all terminals. To switch to an
+    /// ASCII-only variant by default, you can use the `ascii-only` feature.
+    pub fn box_drawing() -> Chars {
         Chars {
-            source_border_top_left: '┌',
-            source_border_top: '─',
+            snippet_start: "┌─".into(),
             source_border_left: '│',
             source_border_left_break: '·',
 
@@ -278,4 +294,36 @@ impl Default for Chars {
             pointer_left: '│',
         }
     }
+
+    /// A character set that only uses ASCII characters.
+    ///
+    /// This is useful if your terminal's font does not support box drawing
+    /// characters well and results in output that looks similar to rustc's
+    /// diagnostic output.
+    ///
+    /// Using the `ascii-only` feature makes this the default.
+    pub fn ascii() -> Chars {
+        Chars {
+            snippet_start: "-->".into(),
+            source_border_left: '|',
+            source_border_left_break: '.',
+
+            note_bullet: '=',
+
+            single_primary_caret: '^',
+            single_secondary_caret: '-',
+
+            multi_primary_caret_start: '^',
+            multi_primary_caret_end: '^',
+            multi_secondary_caret_start: '\'',
+            multi_secondary_caret_end: '\'',
+            multi_top_left: '/',
+            multi_top: '-',
+            multi_bottom_left: '\\',
+            multi_bottom: '-',
+            multi_left: '|',
+
+            pointer_left: '|',
+        }
+    }
 }
diff --git a/codespan-reporting/src/term/renderer.rs b/codespan-reporting/src/term/renderer.rs
index cd82e88..eeb8965 100644
--- a/codespan-reporting/src/term/renderer.rs
+++ b/codespan-reporting/src/term/renderer.rs
@@ -208,8 +208,7 @@ impl<'writer, 'config> Renderer<'writer, 'config> {
         self.outer_gutter(outer_padding)?;
 
         self.set_color(&self.styles().source_border)?;
-        write!(self, "{}", self.chars().source_border_top_left)?;
-        write!(self, "{0}", self.chars().source_border_top)?;
+        write!(self, "{}", self.chars().snippet_start)?;
         self.reset()?;
 
         write!(self, " ")?;


Test patch:
diff --git a/codespan-reporting/tests/snapshots/term__empty__rich_ascii_no_color.snap b/codespan-reporting/tests/snapshots/term__empty__rich_ascii_no_color.snap
new file mode 100644
index 0000000..1ec1a94
--- /dev/null
+++ b/codespan-reporting/tests/snapshots/term__empty__rich_ascii_no_color.snap
@@ -0,0 +1,17 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+bug: 
+
+error: 
+
+warning: 
+
+note: 
+
+help: 
+
+bug: 
+
+
diff --git a/codespan-reporting/tests/snapshots/term__empty_ranges__rich_ascii_no_color.snap b/codespan-reporting/tests/snapshots/term__empty_ranges__rich_ascii_no_color.snap
new file mode 100644
index 0000000..bbf44fb
--- /dev/null
+++ b/codespan-reporting/tests/snapshots/term__empty_ranges__rich_ascii_no_color.snap
@@ -0,0 +1,29 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+note: middle
+  --> hello:1:7
+  |
+1 | Hello world!
+  |       ^ middle
+
+note: end of line
+  --> hello:1:13
+  |
+1 | Hello world!
+  |             ^ end of line
+
+note: end of line
+  --> hello:2:11
+  |
+2 | Bye world!
+  |           ^ end of line
+
+note: end of file
+  --> hello:3:4
+  |
+3 |    
+  |    ^ end of file
+
+
diff --git a/codespan-reporting/tests/snapshots/term__fizz_buzz__rich_ascii_no_color.snap b/codespan-reporting/tests/snapshots/term__fizz_buzz__rich_ascii_no_color.snap
new file mode 100644
index 0000000..55cb453
--- /dev/null
+++ b/codespan-reporting/tests/snapshots/term__fizz_buzz__rich_ascii_no_color.snap
@@ -0,0 +1,42 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error[E0308]: `case` clauses have incompatible types
+  --> FizzBuzz.fun:8:12
+  |  
+3 |   fizz₁ : Nat → String
+  |                 ------ expected type `String` found here
+4 |   fizz₁ num = case (mod num 5) (mod num 3) of
+  | /-------------'
+5 | |     0 0 => "FizzBuzz"
+6 | |     0 _ => "Fizz"
+7 | |     _ 0 => "Buzz"
+8 | |     _ _ => num
+  | |            ^^^ expected `String`, found `Nat`
+  | \--------------' `case` clauses have incompatible types
+  |  
+  = expected type `String`
+       found type `Nat`
+
+error[E0308]: `case` clauses have incompatible types
+   --> FizzBuzz.fun:16:16
+   |  
+10 |   fizz₂ : Nat → String
+   |                 ------ expected type `String` found here
+11 |   fizz₂ num =
+12 | /     case (mod num 5) (mod num 3) of
+13 | |         0 0 => "FizzBuzz"
+   | |                ---------- this is found to be of type `String`
+14 | |         0 _ => "Fizz"
+   | |                ------ this is found to be of type `String`
+15 | |         _ 0 => "Buzz"
+   | |                ------ this is found to be of type `String`
+16 | |         _ _ => num
+   | |                ^^^ expected `String`, found `Nat`
+   | \------------------' `case` clauses have incompatible types
+   |  
+   = expected type `String`
+        found type `Nat`
+
+
diff --git a/codespan-reporting/tests/snapshots/term__message__rich_ascii_no_color.snap b/codespan-reporting/tests/snapshots/term__message__rich_ascii_no_color.snap
new file mode 100644
index 0000000..d3abe84
--- /dev/null
+++ b/codespan-reporting/tests/snapshots/term__message__rich_ascii_no_color.snap
@@ -0,0 +1,13 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error: a message
+
+warning: a message
+
+note: a message
+
+help: a message
+
+
diff --git a/codespan-reporting/tests/snapshots/term__message_and_notes__rich_ascii_no_color.snap b/codespan-reporting/tests/snapshots/term__message_and_notes__rich_ascii_no_color.snap
new file mode 100644
index 0000000..d4e209b
--- /dev/null
+++ b/codespan-reporting/tests/snapshots/term__message_and_notes__rich_ascii_no_color.snap
@@ -0,0 +1,17 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error: a message
+ = a note
+
+warning: a message
+ = a note
+
+note: a message
+ = a note
+
+help: a message
+ = a note
+
+
diff --git a/codespan-reporting/tests/snapshots/term__message_errorcode__rich_ascii_no_color.snap b/codespan-reporting/tests/snapshots/term__message_errorcode__rich_ascii_no_color.snap
new file mode 100644
index 0000000..e82fb7c
--- /dev/null
+++ b/codespan-reporting/tests/snapshots/term__message_errorcode__rich_ascii_no_color.snap
@@ -0,0 +1,21 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error[E0001]: a message
+
+warning[W001]: a message
+
+note[N0815]: a message
+
+help[H4711]: a message
+
+error: where did my errorcode go?
+
+warning: where did my errorcode go?
+
+note: where did my errorcode go?
+
+help: where did my errorcode go?
+
+
diff --git a/codespan-reporting/tests/snapshots/term__multifile__rich_ascii_no_color.snap b/codespan-reporting/tests/snapshots/term__multifile__rich_ascii_no_color.snap
new file mode 100644
index 0000000..e162ed2
--- /dev/null
+++ b/codespan-reporting/tests/snapshots/term__multifile__rich_ascii_no_color.snap
@@ -0,0 +1,35 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error: unknown builtin: `NATRAL`
+  --> Data/Nat.fun:7:13
+  |
+7 | {-# BUILTIN NATRAL Nat #-}
+  |             ^^^^^^ unknown builtin
+  |
+  = there is a builtin with a similar name: `NATURAL`
+
+warning: unused parameter pattern: `n₂`
+   --> Data/Nat.fun:17:16
+   |
+17 | zero    - succ n₂ = zero
+   |                ^^ unused parameter
+   |
+   = consider using a wildcard pattern: `_`
+
+error[E0001]: unexpected type in application of `_+_`
+   --> Test.fun:4:11
+   |
+ 4 | _ = 123 + "hello"
+   |           ^^^^^^^ expected `Nat`, found `String`
+   |
+   --> Data/Nat.fun:11:1
+   |
+11 | _+_ : Nat → Nat → Nat
+   | --------------------- based on the definition of `_+_`
+   |
+   = expected type `Nat`
+        found type `String`
+
+
diff --git a/codespan-reporting/tests/snapshots/term__multiline_overlapping__rich_ascii_no_color.snap b/codespan-reporting/tests/snapshots/term__multiline_overlapping__rich_ascii_no_color.snap
new file mode 100644
index 0000000..3623d4d
--- /dev/null
+++ b/codespan-reporting/tests/snapshots/term__multiline_overlapping__rich_ascii_no_color.snap
@@ -0,0 +1,25 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error[E0308]: match arms have incompatible types
+  --> codespan/src/file.rs:4:34
+  |    
+1 |   /         match line_index.compare(self.last_line_index()) {
+2 |   |             Ordering::Less => Ok(self.line_starts()[line_index.to_usize()]),
+  |   |                               --------------------------------------------- this is found to be of type `Result<ByteIndex, LineIndexOutOfBoundsError>`
+3 |   |             Ordering::Equal => Ok(self.source_span().end()),
+  |   |                                ---------------------------- this is found to be of type `Result<ByteIndex, LineIndexOutOfBoundsError>`
+4 |   |             Ordering::Greater => LineIndexOutOfBoundsError {
+  | /-|----------------------------------^
+5 | | |                 given: line_index,
+6 | | |                 max: self.last_line_index(),
+7 | | |             },
+  | \-|-------------^ expected enum `Result`, found struct `LineIndexOutOfBoundsError`
+8 |   |         }
+  |   \---------' `match` arms have incompatible types
+  |    
+  = expected type `Result<ByteIndex, LineIndexOutOfBoundsError>`
+       found type `LineIndexOutOfBoundsError`
+
+
diff --git a/codespan-reporting/tests/snapshots/term__overlapping__rich_ascii_no_color.snap b/codespan-reporting/tests/snapshots/term__overlapping__rich_ascii_no_color.snap
new file mode 100644
index 0000000..b6002fc
--- /dev/null
+++ b/codespan-reporting/tests/snapshots/term__overlapping__rich_ascii_no_color.snap
@@ -0,0 +1,58 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error[E0666]: nested `impl Trait` is not allowed
+  --> nested_impl_trait.rs:5:56
+  |
+5 | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
+  |                                              ----------^^^^^^^^^^-
+  |                                              |         |
+  |                                              |         nested `impl Trait` here
+  |                                              outer `impl Trait`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+  --> typeck_type_placeholder_item.rs:1:18
+  |
+1 | fn fn_test1() -> _ { 5 }
+  |                  ^
+  |                  |
+  |                  not allowed in type signatures
+  |                  help: replace with the correct return type: `i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+  --> typeck_type_placeholder_item.rs:2:25
+  |
+2 | fn fn_test2(x: i32) -> (_, _) { (x, x) }
+  |                        -^--^-
+  |                        ||  |
+  |                        ||  not allowed in type signatures
+  |                        |not allowed in type signatures
+  |                        help: replace with the correct return type: `(i32, i32)`
+
+error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely
+   --> no_send_res_ports.rs:25:5
+   |  
+25 |       thread::spawn(move|| {
+   |       ^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely
+   | /-------------------'
+26 | |         let y = x;
+27 | |         println!("{:?}", y);
+28 | |     });
+   | \------' within this `[closure@no_send_res_ports.rs:29:19: 33:6 x:main::Foo]`
+   |  
+   --> libstd/thread/mod.rs:5:8
+   |
+ 5 |     F: Send + 'static,
+   |        ---- required by this bound in `std::thread::spawn`
+   |
+   = help: within `[closure@no_send_res_ports.rs:29:19: 33:6 x:main::Foo]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
+   = note: required because it appears within the type `Port<()>`
+   = note: required because it appears within the type `main::Foo`
+   = note: required because it appears within the type `[closure@no_send_res_ports.rs:29:19: 33:6 x:main::Foo]`
+
+error: aborting due 5 previous errors
+ = Some errors have detailed explanations: E0121, E0277, E0666.
+ = For more information about an error, try `rustc --explain E0121`.
+
+
diff --git a/codespan-reporting/tests/snapshots/term__position_indicator__rich_ascii_no_color.snap b/codespan-reporting/tests/snapshots/term__position_indicator__rich_ascii_no_color.snap
new file mode 100644
index 0000000..d99ad14
--- /dev/null
+++ b/codespan-reporting/tests/snapshots/term__position_indicator__rich_ascii_no_color.snap
@@ -0,0 +1,14 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+warning[ParserWarning]: The strict mode declaration in the body of function `foo` is redundant, as the outer scope is already in strict mode
+  --> tests/main.js:4:3
+  |
+1 | "use strict";
+  | ------------ Strict mode is first declared here
+  .
+4 |   "use strict";
+  |   ^^^^^^^^^^^^ This strict mode declaration is redundant
+
+
diff --git a/codespan-reporting/tests/snapshots/term__same_line__rich_ascii_no_color.snap b/codespan-reporting/tests/snapshots/term__same_line__rich_ascii_no_color.snap
new file mode 100644
index 0000000..60e7afb
--- /dev/null
+++ b/codespan-reporting/tests/snapshots/term__same_line__rich_ascii_no_color.snap
@@ -0,0 +1,17 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error[E0499]: cannot borrow `v` as mutable more than once at a time
+  --> one_line.rs:3:12
+  |
+3 |     v.push(v.pop().unwrap());
+  |     - ---- ^ second mutable borrow occurs here
+  |     | |     
+  |     | first mutable borrow occurs here
+  |     first borrow later used by call
+
+error: aborting due to previous error
+ = For more information about this error, try `rustc --explain E0499`.
+
+
diff --git a/codespan-reporting/tests/snapshots/term__same_ranges__rich_ascii_no_color.snap b/codespan-reporting/tests/snapshots/term__same_ranges__rich_ascii_no_color.snap
new file mode 100644
index 0000000..d64f099
--- /dev/null
+++ b/codespan-reporting/tests/snapshots/term__same_ranges__rich_ascii_no_color.snap
@@ -0,0 +1,14 @@
+---
+source: codespan-reporting/tests/term.rs
+expression: TEST_DATA.emit_no_color(&config)
+---
+error: Unexpected token
+  --> same_range:1:5
+  |
+1 | ::S { }
+  |     ^
+  |     |
+  |     Unexpected '{'
+  |     Expected '('
+
+
diff --git a/codespan-reporting/tests/term.rs b/codespan-reporting/tests/term.rs
index 15c9566..035db9b 100644
--- a/codespan-reporting/tests/term.rs
+++ b/codespan-reporting/tests/term.rs
@@ -1,6 +1,6 @@
 use codespan_reporting::diagnostic::{Diagnostic, Label};
 use codespan_reporting::files::{SimpleFile, SimpleFiles};
-use codespan_reporting::term::{termcolor::Color, Config, DisplayStyle, Styles};
+use codespan_reporting::term::{termcolor::Color, Chars, Config, DisplayStyle, Styles};
 
 mod support;
 
@@ -78,6 +78,18 @@ macro_rules! test_emit {
                 ..TEST_CONFIG.clone()
             };
 
+            insta::assert_snapshot!(TEST_DATA.emit_no_color(&config));
+        }
+    };
+    (rich_ascii_no_color) => {
+        #[test]
+        fn rich_ascii_no_color() {
+            let config = Config {
+                display_style: DisplayStyle::Rich,
+                chars: Chars::ascii(),
+                ..TEST_CONFIG.clone()
+            };
+
             insta::assert_snapshot!(TEST_DATA.emit_no_color(&config));
         }
     };
@@ -109,6 +121,7 @@ mod empty {
     test_emit!(rich_no_color);
     test_emit!(medium_no_color);
     test_emit!(short_no_color);
+    test_emit!(rich_ascii_no_color);
 }
 
 /// Based on:
@@ -159,6 +172,7 @@ mod same_line {
     test_emit!(rich_no_color);
     test_emit!(medium_no_color);
     test_emit!(short_no_color);
+    test_emit!(rich_ascii_no_color);
 }
 
 /// Based on:
@@ -303,6 +317,7 @@ mod overlapping {
     test_emit!(rich_no_color);
     test_emit!(medium_no_color);
     test_emit!(short_no_color);
+    test_emit!(rich_ascii_no_color);
 }
 
 mod message {
@@ -329,6 +344,7 @@ mod message {
     test_emit!(rich_no_color);
     test_emit!(medium_no_color);
     test_emit!(short_no_color);
+    test_emit!(rich_ascii_no_color);
 }
 
 mod message_and_notes {
@@ -355,6 +371,7 @@ mod message_and_notes {
     test_emit!(rich_no_color);
     test_emit!(medium_no_color);
     test_emit!(short_no_color);
+    test_emit!(rich_ascii_no_color);
 }
 
 mod message_errorcode {
@@ -381,6 +398,7 @@ mod message_errorcode {
 
     test_emit!(rich_no_color);
     test_emit!(short_no_color);
+    test_emit!(rich_ascii_no_color);
 }
 
 mod empty_ranges {
@@ -416,6 +434,7 @@ mod empty_ranges {
     test_emit!(rich_no_color);
     test_emit!(medium_no_color);
     test_emit!(short_no_color);
+    test_emit!(rich_ascii_no_color);
 }
 
 mod same_ranges {
@@ -444,6 +463,7 @@ mod same_ranges {
     test_emit!(rich_no_color);
     test_emit!(medium_no_color);
     test_emit!(short_no_color);
+    test_emit!(rich_ascii_no_color);
 }
 
 mod multifile {
@@ -530,6 +550,7 @@ mod multifile {
     test_emit!(rich_no_color);
     test_emit!(medium_no_color);
     test_emit!(short_no_color);
+    test_emit!(rich_ascii_no_color);
 }
 
 mod fizz_buzz {
@@ -609,6 +630,7 @@ mod fizz_buzz {
     test_emit!(rich_no_color);
     test_emit!(medium_no_color);
     test_emit!(short_no_color);
+    test_emit!(rich_ascii_no_color);
 }
 
 mod multiline_overlapping {
@@ -659,6 +681,7 @@ mod multiline_overlapping {
     test_emit!(rich_no_color);
     test_emit!(medium_no_color);
     test_emit!(short_no_color);
+    test_emit!(rich_ascii_no_color);
 }
 
 mod tabbed {
@@ -950,6 +973,7 @@ mod position_indicator {
     test_emit!(rich_no_color);
     test_emit!(medium_no_color);
     test_emit!(short_no_color);
+    test_emit!(rich_ascii_no_color);
 }
 
 mod multiline_omit {