Skip to content

Commit

Permalink
Fix truncated bang operator error message
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Dec 11, 2024
1 parent 5642b14 commit 524e12e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compile_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ impl Display for CompileError<'_> {
UnexpectedEndOfToken { expected } => {
write!(
f,
"Expected character `{}` but found end-of-file",
"Expected character {} but found end-of-file",
List::or_ticked(expected),
)
}
Expand Down
17 changes: 17 additions & 0 deletions tests/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,20 @@ error: Expected character `=` or `~`
)
.run();
}

#[test]
fn truncated_bang_operator() {
Test::new()
.justfile("x := if '' !")
.status(1)
.stderr(
r"
error: Expected character `=` or `~` but found end-of-file
——▶ justfile:1:13
1 │ x := if '' !
│ ^
",
)
.run();
}

0 comments on commit 524e12e

Please sign in to comment.