diff --git a/src/app.rs b/src/app.rs index 73d3d87..dc33e52 100644 --- a/src/app.rs +++ b/src/app.rs @@ -43,7 +43,7 @@ impl UseColor { match self { UseColor::Auto => atty::is(stream), UseColor::Always => true, - UseColor::Never => true, + UseColor::Never => false, } } } diff --git a/src/integration.rs b/src/integration.rs index 36cda75..ed6a1d2 100644 --- a/src/integration.rs +++ b/src/integration.rs @@ -917,7 +917,7 @@ fn unknown_recipes() { } #[test] -fn colors_with_context() { +fn color_always() { integration_test( &["--color", "always"], "b = a\na = `exit 100`\nbar:\n echo '{{`exit 200`}}'", @@ -927,6 +927,36 @@ fn colors_with_context() { ); } +#[test] +fn color_never() { + integration_test( + &["--color", "never"], + "b = a\na = `exit 100`\nbar:\n echo '{{`exit 200`}}'", + 100, + "", + "error: backtick failed with exit code 100 + | +2 | a = `exit 100` + | ^^^^^^^^^^ +", + ); +} + +#[test] +fn color_auto() { + integration_test( + &["--color", "auto"], + "b = a\na = `exit 100`\nbar:\n echo '{{`exit 200`}}'", + 100, + "", + "error: backtick failed with exit code 100 + | +2 | a = `exit 100` + | ^^^^^^^^^^ +", + ); +} + #[test] fn colors_no_context() { let text ="