Index: third_party/WebKit/Source/core/html/parser/HTMLParserIdiomsTest.cpp |
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserIdiomsTest.cpp b/third_party/WebKit/Source/core/html/parser/HTMLParserIdiomsTest.cpp |
index d9b4ade75a8adf837e8e8b60ae709e945075b750..556058fd79af22a240a993f46ac4ba100ef98c19 100644 |
--- a/third_party/WebKit/Source/core/html/parser/HTMLParserIdiomsTest.cpp |
+++ b/third_party/WebKit/Source/core/html/parser/HTMLParserIdiomsTest.cpp |
@@ -10,6 +10,26 @@ namespace blink { |
namespace { |
+TEST(HTMLParserIdiomsTest, ParseHTMLInteger) { |
+ int value = 0; |
+ |
+ EXPECT_TRUE(parseHTMLInteger("2147483646", value)); |
+ EXPECT_EQ(2147483646, value); |
+ EXPECT_TRUE(parseHTMLInteger("2147483647", value)); |
+ EXPECT_EQ(2147483647, value); |
+ value = 12345; |
+ EXPECT_FALSE(parseHTMLInteger("2147483648", value)); |
+ EXPECT_EQ(12345, value); |
+ |
+ EXPECT_TRUE(parseHTMLInteger("-2147483647", value)); |
+ EXPECT_EQ(-2147483647, value); |
+ EXPECT_TRUE(parseHTMLInteger("-2147483648", value)); |
+ EXPECT_EQ(0 - 2147483648, value); |
+ value = 12345; |
+ EXPECT_FALSE(parseHTMLInteger("-2147483649", value)); |
+ EXPECT_EQ(12345, value); |
+} |
+ |
TEST(HTMLParserIdiomsTest, ParseHTMLNonNegativeInteger) { |
unsigned value = 0; |