From 1168aedc4dfe09a7106ba1d589df03af6e42824d Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 14 Jan 2019 10:11:05 -0800 Subject: [PATCH] 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. --- tests/test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.rs b/tests/test.rs index ac8d9e1..7dd6abf 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -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::(&[(&brackets, "recursion limit exceeded at line 1 column 128")]); }