🔨 removed unexpect function
This commit is contained in:
parent
2fd214c14b
commit
6f3bebff5c
3 changed files with 28 additions and 28 deletions
|
|
@ -694,15 +694,15 @@ TEST_CASE("parser class")
|
|||
CHECK_THROWS_AS(json::parser(json::input_adapter::create(std::string("[1,]"))).parse(), json::parse_error);
|
||||
CHECK_THROWS_AS(json::parser(json::input_adapter::create(std::string("]"))).parse(), json::parse_error);
|
||||
CHECK_THROWS_WITH(json::parser(json::input_adapter::create(std::string("["))).parse(),
|
||||
"[json.exception.parse_error.101] parse error at 2: syntax error - unexpected end of input");
|
||||
"[json.exception.parse_error.101] parse error at 2: syntax error - unexpected end of input; expected '[', '{', or a literal");
|
||||
CHECK_THROWS_WITH(json::parser(json::input_adapter::create(std::string("[1"))).parse(),
|
||||
"[json.exception.parse_error.101] parse error at 3: syntax error - unexpected end of input; expected ']'");
|
||||
CHECK_THROWS_WITH(json::parser(json::input_adapter::create(std::string("[1,"))).parse(),
|
||||
"[json.exception.parse_error.101] parse error at 4: syntax error - unexpected end of input");
|
||||
"[json.exception.parse_error.101] parse error at 4: syntax error - unexpected end of input; expected '[', '{', or a literal");
|
||||
CHECK_THROWS_WITH(json::parser(json::input_adapter::create(std::string("[1,]"))).parse(),
|
||||
"[json.exception.parse_error.101] parse error at 4: syntax error - unexpected ']'");
|
||||
"[json.exception.parse_error.101] parse error at 4: syntax error - unexpected ']'; expected '[', '{', or a literal");
|
||||
CHECK_THROWS_WITH(json::parser(json::input_adapter::create(std::string("]"))).parse(),
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected ']'");
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected ']'; expected '[', '{', or a literal");
|
||||
|
||||
// missing/unexpected end of object
|
||||
CHECK_THROWS_AS(json::parser(json::input_adapter::create(std::string("{"))).parse(), json::parse_error);
|
||||
|
|
@ -716,13 +716,13 @@ TEST_CASE("parser class")
|
|||
CHECK_THROWS_WITH(json::parser(json::input_adapter::create(std::string("{\"foo\""))).parse(),
|
||||
"[json.exception.parse_error.101] parse error at 7: syntax error - unexpected end of input; expected ':'");
|
||||
CHECK_THROWS_WITH(json::parser(json::input_adapter::create(std::string("{\"foo\":"))).parse(),
|
||||
"[json.exception.parse_error.101] parse error at 8: syntax error - unexpected end of input");
|
||||
"[json.exception.parse_error.101] parse error at 8: syntax error - unexpected end of input; expected '[', '{', or a literal");
|
||||
CHECK_THROWS_WITH(json::parser(json::input_adapter::create(std::string("{\"foo\":}"))).parse(),
|
||||
"[json.exception.parse_error.101] parse error at 8: syntax error - unexpected '}'");
|
||||
"[json.exception.parse_error.101] parse error at 8: syntax error - unexpected '}'; expected '[', '{', or a literal");
|
||||
CHECK_THROWS_WITH(json::parser(json::input_adapter::create(std::string("{\"foo\":1,}"))).parse(),
|
||||
"[json.exception.parse_error.101] parse error at 10: syntax error - unexpected '}'; expected string literal");
|
||||
CHECK_THROWS_WITH(json::parser(json::input_adapter::create(std::string("}"))).parse(),
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected '}'");
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected '}'; expected '[', '{', or a literal");
|
||||
|
||||
// missing/unexpected end of string
|
||||
CHECK_THROWS_AS(json::parser(json::input_adapter::create(std::string("\""))).parse(), json::parse_error);
|
||||
|
|
|
|||
|
|
@ -597,7 +597,7 @@ TEST_CASE("regression tests")
|
|||
// a parse error because of the EOF.
|
||||
CHECK_THROWS_AS(ss >> j, json::parse_error);
|
||||
CHECK_THROWS_WITH(ss >> j,
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input");
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input; expected '[', '{', or a literal");
|
||||
}
|
||||
|
||||
SECTION("issue #367 - behavior of operator>> should more closely resemble that of built-in overloads")
|
||||
|
|
@ -608,7 +608,7 @@ TEST_CASE("regression tests")
|
|||
json j;
|
||||
CHECK_THROWS_AS(ss >> j, json::parse_error);
|
||||
CHECK_THROWS_WITH(ss >> j,
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input");
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input; expected '[', '{', or a literal");
|
||||
}
|
||||
|
||||
SECTION("(whitespace)")
|
||||
|
|
@ -618,7 +618,7 @@ TEST_CASE("regression tests")
|
|||
json j;
|
||||
CHECK_THROWS_AS(ss >> j, json::parse_error);
|
||||
CHECK_THROWS_WITH(ss >> j,
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input");
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input; expected '[', '{', or a literal");
|
||||
}
|
||||
|
||||
SECTION("one value")
|
||||
|
|
@ -631,7 +631,7 @@ TEST_CASE("regression tests")
|
|||
|
||||
CHECK_THROWS_AS(ss >> j, json::parse_error);
|
||||
CHECK_THROWS_WITH(ss >> j,
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input");
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input; expected '[', '{', or a literal");
|
||||
}
|
||||
|
||||
SECTION("one value + whitespace")
|
||||
|
|
@ -644,7 +644,7 @@ TEST_CASE("regression tests")
|
|||
|
||||
CHECK_THROWS_AS(ss >> j, json::parse_error);
|
||||
CHECK_THROWS_WITH(ss >> j,
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input");
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input; expected '[', '{', or a literal");
|
||||
}
|
||||
|
||||
SECTION("whitespace + one value")
|
||||
|
|
@ -657,7 +657,7 @@ TEST_CASE("regression tests")
|
|||
|
||||
CHECK_THROWS_AS(ss >> j, json::parse_error);
|
||||
CHECK_THROWS_WITH(ss >> j,
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input");
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input; expected '[', '{', or a literal");
|
||||
}
|
||||
|
||||
SECTION("three values")
|
||||
|
|
@ -674,7 +674,7 @@ TEST_CASE("regression tests")
|
|||
|
||||
CHECK_THROWS_AS(ss >> j, json::parse_error);
|
||||
CHECK_THROWS_WITH(ss >> j,
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input");
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input; expected '[', '{', or a literal");
|
||||
}
|
||||
|
||||
SECTION("literals without whitespace")
|
||||
|
|
@ -693,7 +693,7 @@ TEST_CASE("regression tests")
|
|||
|
||||
CHECK_THROWS_AS(ss >> j, json::parse_error);
|
||||
CHECK_THROWS_WITH(ss >> j,
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input");
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input; expected '[', '{', or a literal");
|
||||
}
|
||||
|
||||
SECTION("example from #529")
|
||||
|
|
@ -708,7 +708,7 @@ TEST_CASE("regression tests")
|
|||
|
||||
CHECK_THROWS_AS(ss >> j, json::parse_error);
|
||||
CHECK_THROWS_WITH(ss >> j,
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input");
|
||||
"[json.exception.parse_error.101] parse error at 1: syntax error - unexpected end of input; expected '[', '{', or a literal");
|
||||
}
|
||||
|
||||
SECTION("second example from #529")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue