Add regression test for infinite loop.

This commit is contained in:
Joe Neeman 2024-09-23 21:22:13 +07:00 committed by Ethiraric
parent 26707be38d
commit 982407774e

View file

@ -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"
);
}