Skip to content

Commit

Permalink
Add test for redefinition error messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaddeo committed Sep 10, 2024
1 parent 4910eb3 commit e95f003
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/error_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,21 @@ fn file_paths_not_in_subdir_are_absolute() {
)
.run();
}

#[test]
fn redefinition_errors_properly_swap_types() {
Test::new()
.write("foo.just", "foo:")
.justfile("foo:\n echo foo\n\nmod foo 'foo.just'")
.status(EXIT_FAILURE)
.stderr(format!(
"
error: Recipe `foo` defined on line 1 is redefined as a module on line 4
——▶ justfile:4:5
4 │ mod foo 'foo.just'
│ ^^^
",
))
.run();
}

0 comments on commit e95f003

Please sign in to comment.