Skip to content

Commit

Permalink
Test unpaired escaped carriage return error (#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Jul 25, 2023
1 parent 30bcf28 commit 53d5f00
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions tests/newline_escape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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();
Expand Down

0 comments on commit 53d5f00

Please sign in to comment.