1
1
mirror of https://github.com/casey/just.git synced 2024-11-23 11:04:09 +03:00
just/tests/error_messages.rs
Casey Rodarmor 7efb82f4cb
Fix colors (#927)
- Re-enable error colors
- Color argument count mismatch usage string
2021-07-29 01:27:47 +00:00

42 lines
737 B
Rust

use crate::common::*;
test! {
name: expected_keyword,
justfile: "foo := if '' == '' { '' } arlo { '' }",
stderr: "
error: Expected keyword `else` but found identifier `arlo`
|
1 | foo := if '' == '' { '' } arlo { '' }
| ^^^^
",
status: EXIT_FAILURE,
}
test! {
name: unexpected_character,
justfile: "!~",
stderr: "
error: Expected character `=`
|
1 | !~
| ^
",
status: EXIT_FAILURE,
}
#[test]
fn argument_count_mismatch() {
Test::new()
.justfile("foo a b:")
.args(&["foo"])
.stderr(
"
error: Recipe `foo` got 0 arguments but takes 2
usage:
just foo a b
",
)
.status(EXIT_FAILURE)
.run();
}