Skip to content

Commit

Permalink
Merge pull request #125 from ltratt/error_on_duplicate_ignore_if
Browse files Browse the repository at this point in the history
Raise an error if `ignore-if` is specified more than once.
  • Loading branch information
vext01 committed Mar 20, 2024
2 parents 4dd211b + 5db01d7 commit adafdff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ pub(crate) fn parse_tests<'a>(comment_prefix: Option<&str>, test_str: &'a str) -
}
let (test_name, val) = key_val(&lines, line_off, indent);
if test_name == "ignore-if" {
if ignore_if.is_some() {
fatal(&format!(
"'ignore-if' is specified more than once, line {}.",
line_off
))
}
ignore_if = Some(val.into());
line_off += 1;
continue;
Expand Down

0 comments on commit adafdff

Please sign in to comment.