Skip to content

Commit

Permalink
Fix test for replace_into_stdout, since color was added
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus789 committed May 5, 2021
1 parent 7d73f9f commit 2b3b201
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ mod cli {
let mut file = tempfile::NamedTempFile::new()?;
file.write(b"abc123def")?;

#[rustfmt::skip]
sd().args(&["-p", "abc\\d+", "", file.path().to_str().unwrap()])
.assert()
.success()
.stdout("def");
sd().args(&["-p", "abc\\d+", "", file.path().to_str().unwrap()])
.assert()
.success()
.stdout(format!(
"{}{}def",
ansi_term::Color::Green.prefix().to_string(),
ansi_term::Color::Green.suffix().to_string()
));

assert_file(file.path(), "abc123def");

Expand Down

0 comments on commit 2b3b201

Please sign in to comment.