From a7e0c887dbc7a33ba8eec470d05711022cbc4530 Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Wed, 7 Mar 2018 15:19:42 +0100 Subject: [PATCH] Added test case for recursion depth 240 --- tests/io/json_tests.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/io/json_tests.cpp b/tests/io/json_tests.cpp index d86b743..4e4cb5c 100644 --- a/tests/io/json_tests.cpp +++ b/tests/io/json_tests.cpp @@ -75,6 +75,10 @@ static void test_fail_file( const std::string& str ) BOOST_AUTO_TEST_CASE(imbalanced_test) { + std::string open40("[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["); + std::string close40("]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]"); + std::string open80 = open40 + open40; + std::string close80 = close40 + close40; std::vector tests { // for easier handling and better readability, in the following test // strings ' is used instead of " and \1 instead of \0 @@ -106,7 +110,9 @@ BOOST_AUTO_TEST_CASE(imbalanced_test) "['\1]", "[ 13\1", "[ 13\1]", - "' end\1" + "' end\1", + open80 + "'" + close80 + close80 + "'," + open80 + open80 + + close80 + close80 + close80 }; for( std::string test : tests )