Skip to content

Commit

Permalink
Add regression test for infinite loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
jneem authored and Ethiraric committed Oct 17, 2024
1 parent 26707be commit 9824077
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions parser/tests/issues.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,17 @@ fn test_pr12() {
]
);
}

#[test]
fn test_issue13() {
let s = "{---";
let Err(error) = run_parser(s) else { panic!() };
assert_eq!(
error.info(),
"while parsing a flow mapping, did not find expected ',' or '}'"
);
assert_eq!(
error.to_string(),
"while parsing a flow mapping, did not find expected ',' or '}' at byte 4 line 2 column 1"
);
}

0 comments on commit 9824077

Please sign in to comment.