More sensitive test for recursion error

If eat_char is moved before the recursion check, the original test will
continue to pass but the new test will catch it.
This commit is contained in:
David Tolnay 2019-01-14 10:11:05 -08:00
parent 19c959cf92
commit 1168aedc4d
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -1760,7 +1760,7 @@ fn test_stack_overflow() {
.collect();
let _: Value = from_str(&brackets).unwrap();
let brackets: String = iter::repeat('[').take(128).collect();
let brackets: String = iter::repeat('[').take(129).collect();
test_parse_err::<Value>(&[(&brackets, "recursion limit exceeded at line 1 column 128")]);
}