Skip to content

Commit

Permalink
add a test to check if malformed rules are properly skipped
Browse files Browse the repository at this point in the history
closes #27
  • Loading branch information
rfuzzo committed Mar 17, 2024
1 parent 1e3265c commit 8304e0d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/unit_parser_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ mod unit_tests {
}
}

#[test]
fn test_invalid_rule() {
let input = "[Order]\nab01GOTYpatch.esp\n;JoinAll*.esp";

let reader = Cursor::new(input.as_bytes());
let rules = parser::new_cyberpunk_parser()
.parse_rules_from_reader(reader)
.expect("Failed to parse rule");

// should not parse any rule here
assert!(rules.is_empty());
}

////////////////////////////////////////////////////////////////////////
// NEARSTART

Expand Down

0 comments on commit 8304e0d

Please sign in to comment.