Don't ignore --color=never
(#56)
Fixes a bug where `--color=never` was ignored.
This commit is contained in:
parent
ac7634000e
commit
2882b78de5
@ -43,7 +43,7 @@ impl UseColor {
|
||||
match self {
|
||||
UseColor::Auto => atty::is(stream),
|
||||
UseColor::Always => true,
|
||||
UseColor::Never => true,
|
||||
UseColor::Never => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 ="
|
||||
|
Loading…
Reference in New Issue
Block a user