File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
include/tao/json/internal Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ namespace tao
7474 static void apply ( const tao_json_pegtl::input & in, number_state & result )
7575 {
7676 if ( in.size () > ( 1 << 20 ) ) {
77- throw tao_json_pegtl::parse_error ( " json number with 1 megabyte digits" , in );
77+ throw tao_json_pegtl::parse_error ( " JSON number with 1 megabyte digits" , in );
7878 }
7979 const auto c = std::min ( in.size (), max_mantissa_digits );
8080 std::memcpy ( result.mantissa + 1 , in.begin (), c );
@@ -136,7 +136,7 @@ namespace tao
136136 ++b;
137137 }
138138 if ( ( in.end () - b ) > 9 ) {
139- throw tao_json_pegtl::parse_error ( " json exponent has more than 9 significant digits" , in );
139+ throw tao_json_pegtl::parse_error ( " JSON exponent has more than 9 significant digits" , in );
140140 }
141141 int exponent10 = 0 ;
142142
Original file line number Diff line number Diff line change @@ -98,10 +98,14 @@ namespace tao
9898 TEST_ASSERT ( from_string ( " -9223372036854775808" ) == -9223372036854775807ll - 1 );
9999 TEST_ASSERT ( from_string ( " 18446744073709551615" ) == 18446744073709551615ull );
100100
101- // TODO: test_integer()
102101 test_array ();
103102 test_object ();
104103
104+ // TODO: Other integer tests missing from integer.cc?
105+
106+ TEST_THROWS ( from_string ( " 1" + std::string ( internal::max_mantissa_digits - 2 , ' 0' ) + " 0" ) ); // Throws due to overflow.
107+ TEST_THROWS ( from_string ( " 1" + std::string ( internal::max_mantissa_digits - 2 , ' 0' ) + " 1" ) ); // Throws due to overflow.
108+
105109 TEST_THROWS ( from_string ( " " ) );
106110 TEST_THROWS ( from_string ( " [" ) );
107111 TEST_THROWS ( from_string ( " {" ) );
You can’t perform that action at this time.
0 commit comments