diff options
Diffstat (limited to 'base/string_util_unittest.cc')
-rw-r--r-- | base/string_util_unittest.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/base/string_util_unittest.cc b/base/string_util_unittest.cc index 837e000..9b0f9b6 100644 --- a/base/string_util_unittest.cc +++ b/base/string_util_unittest.cc @@ -671,6 +671,7 @@ TEST(StringUtilTest, StringToInt) { {"2147483647", INT_MAX, true}, {"", 0, false}, {" 42", 42, false}, + {"42 ", 42, false}, {"\t\n\v\f\r 42", 42, false}, {"blah42", 0, false}, {"42blah", 42, false}, @@ -734,6 +735,7 @@ TEST(StringUtilTest, StringToInt64) { {"-09", -9, true}, {"", 0, false}, {" 42", 42, false}, + {"42 ", 42, false}, {"\t\n\v\f\r 42", 42, false}, {"blah42", 0, false}, {"42blah", 42, false}, @@ -802,6 +804,8 @@ TEST(StringUtilTest, HexStringToInt) { {"0f", 15, true}, {" 45", 0x45, false}, {"\t\n\v\f\r 0x45", 0x45, false}, + {" 45", 0x45, false}, + {"45 ", 0x45, false}, {"efgh", 0xef, false}, {"0xefgh", 0xef, false}, {"hgfe", 0, false}, @@ -853,6 +857,8 @@ TEST(StringUtilTest, StringToDouble) { {"9e99999999999999999999", HUGE_VAL, false}, {"-9e99999999999999999999", -HUGE_VAL, false}, {"1e-2", 0.01, true}, + {" 1e-2", 0.01, false}, + {"1e-2 ", 0.01, false}, {"-1E-7", -0.0000001, true}, {"01e02", 100, true}, {"2.3e15", 2.3e15, true}, |