Skip to content

Commit

Permalink
more tests for exceptions (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Dec 25, 2015
1 parent 76e5e29 commit dc8ab92
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 93 deletions.
6 changes: 3 additions & 3 deletions src/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6371,7 +6371,8 @@ class basic_json
@param[in] codepoint1 the code point (can be high surrogate)
@param[in] codepoint2 the code point (can be low surrogate or 0)
@return string representation of the code point
@throw std::out_of_range if code point is >0x10ffff
@throw std::out_of_range if code point is >0x10ffff; example: `"code
points above 0x10FFFF are invalid"`
@throw std::invalid_argument if the low surrogate is invalid
@see <http://en.wikipedia.org/wiki/UTF-8#Sample_code>
Expand Down Expand Up @@ -7765,8 +7766,7 @@ class basic_json
{
std::string error_msg = "parse error - unexpected \'";
error_msg += m_lexer.get_token();
error_msg += "\' (";
error_msg += lexer::token_type_name(last_token) + ")";
error_msg += "\'";
throw std::invalid_argument(error_msg);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/json.hpp.re2c
Original file line number Diff line number Diff line change
Expand Up @@ -6371,7 +6371,8 @@ class basic_json
@param[in] codepoint1 the code point (can be high surrogate)
@param[in] codepoint2 the code point (can be low surrogate or 0)
@return string representation of the code point
@throw std::out_of_range if code point is >0x10ffff
@throw std::out_of_range if code point is >0x10ffff; example: `"code
points above 0x10FFFF are invalid"`
@throw std::invalid_argument if the low surrogate is invalid

@see <http://en.wikipedia.org/wiki/UTF-8#Sample_code>
Expand Down Expand Up @@ -7044,8 +7045,7 @@ class basic_json
{
std::string error_msg = "parse error - unexpected \'";
error_msg += m_lexer.get_token();
error_msg += "\' (";
error_msg += lexer::token_type_name(last_token) + ")";
error_msg += "\'";
throw std::invalid_argument(error_msg);
}
}
Expand Down
Loading

0 comments on commit dc8ab92

Please sign in to comment.