Added a unit test for SkipWhitespace()

This commit is contained in:
Milo Yip 2014-06-24 23:04:27 +08:00
parent 84f64ba58a
commit 4bf350c5f9

View File

@ -576,3 +576,12 @@ TEST(Reader, Parse_Error) {
#undef TEST_ERROR
}
TEST(Reader, SkipWhitespace) {
StringStream ss(" A \t\tB\n \n\nC\r\r \rD \t\n\r E");
const char* expected = "ABCDE";
for (size_t i = 0; i < 5; i++) {
SkipWhitespace(ss);
EXPECT_EQ(expected[i], ss.Take());
}
}