Skip to content

Commit

Permalink
Add test for unpaired escaped carriage return
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Jul 25, 2023
1 parent 30bcf28 commit a4e61e8
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 a4e61e8

Please sign in to comment.