1
1
mirror of https://github.com/casey/just.git synced 2024-11-26 11:43:43 +03:00

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()
.justfile(
"
default: a\\\r
b
a:
echo a
b:
echo b
",
default: a\\\r
b
a:
echo a
b:
echo b
",
)
.stdout("a\nb\n")
.stderr("echo a\necho b\n")
@ -70,7 +70,32 @@ fn newline_escape_deps_invalid_esc() {
)
.stdout("")
.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)
.run();