mirror of
https://github.com/casey/just.git
synced 2024-11-26 23:27:26 +03:00
8b7640b633
When a recipe wraps cli tool and the tool exits with a non-zero code, just adds its own extra exit error message along with the messages from the tool. Introduce the `[no-exit-message]` attribute to suppress this additional message.
53 lines
877 B
Rust
53 lines
877 B
Rust
use super::*;
|
|
|
|
#[test]
|
|
fn ignore_leading_byte_order_mark() {
|
|
Test::new()
|
|
.justfile(
|
|
"
|
|
\u{feff}foo:
|
|
echo bar
|
|
",
|
|
)
|
|
.stderr("echo bar\n")
|
|
.stdout("bar\n")
|
|
.run();
|
|
}
|
|
|
|
#[test]
|
|
fn non_leading_byte_order_mark_produces_error() {
|
|
Test::new()
|
|
.justfile(
|
|
"
|
|
foo:
|
|
echo bar
|
|
\u{feff}
|
|
",
|
|
)
|
|
.stderr(
|
|
"
|
|
error: Expected \'@\', \'[\', comment, end of file, end of line, or identifier, but found byte order mark
|
|
|
|
|
3 | \u{feff}
|
|
| ^
|
|
")
|
|
.status(EXIT_FAILURE)
|
|
.run();
|
|
}
|
|
|
|
#[test]
|
|
fn dont_mention_byte_order_mark_in_errors() {
|
|
Test::new()
|
|
.justfile("{")
|
|
.stderr(
|
|
"
|
|
error: Expected '@', '[', comment, end of file, end of line, or identifier, but found '{'
|
|
|
|
|
1 | {
|
|
| ^
|
|
",
|
|
)
|
|
.status(EXIT_FAILURE)
|
|
.run();
|
|
}
|