Test unpaired escaped carriage return error (#1650)

This commit is contained in:
Casey Rodarmor 2023-07-25 02:14:13 -07:00 committed by GitHub
parent 30bcf28fde
commit 53d5f004df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,13 +47,13 @@ fn newline_escape_deps_linefeed() {
Test::new() Test::new()
.justfile( .justfile(
" "
default: a\\\r default: a\\\r
b b
a: a:
echo a echo a
b: b:
echo b echo b
", ",
) )
.stdout("a\nb\n") .stdout("a\nb\n")
.stderr("echo a\necho b\n") .stderr("echo a\necho b\n")
@ -70,7 +70,32 @@ fn newline_escape_deps_invalid_esc() {
) )
.stdout("") .stdout("")
.stderr( .stderr(
"error: `\\ ` is not a valid escape sequence\n |\n1 | default: a\\ b\n | ^\n", "
error: `\\ ` is not a valid escape sequence
|
1 | default: a\\ b
| ^
",
)
.status(EXIT_FAILURE)
.run();
}
#[test]
fn newline_escape_unpaired_linefeed() {
Test::new()
.justfile(
"
default:\\\ra",
)
.stdout("")
.stderr(
"
error: Unpaired carriage return
|
1 | default:\\\ra
| ^
",
) )
.status(EXIT_FAILURE) .status(EXIT_FAILURE)
.run(); .run();