Closed josecelano closed 11 months ago
Good catch. I found it too, and there is a nuance here.
colored
crate will rely on is-terminal crate to determin whether the String needs to be colored.
Say when you redirect the output, like cargo prettt-test > out.txt
, you'll see out.txt
doesn't contain the escape characters.
And now CI still fail on stable and nightly Rust, because I guess non-escaping vs escaping happens in there
So the real fix I think is to use cargo test --features "colored/no-color" ...rest arguments
to prevent any escaping in testing.
I've opened PR https://github.com/josecelano/cargo-pretty-test/pull/19 to replace this.
Red color hidden chars were added to the pretty output and the snapshot was updated.