Commit 3d106085 authored by Milo Yip's avatar Milo Yip

Add a space in multiple root test for ensuring that whitespace is not consumed when done.

parent e09b9d5c
...@@ -559,14 +559,15 @@ struct ParseMultipleRootHandler : BaseReaderHandler<> { ...@@ -559,14 +559,15 @@ struct ParseMultipleRootHandler : BaseReaderHandler<> {
template <unsigned parseFlags> template <unsigned parseFlags>
void TestMultipleRoot() { void TestMultipleRoot() {
StringStream s("{}[]a"); StringStream s("{}[] a");
ParseMultipleRootHandler h; ParseMultipleRootHandler h;
Reader reader; Reader reader;
EXPECT_TRUE(reader.Parse<parseFlags>(s, h)); EXPECT_TRUE(reader.Parse<parseFlags>(s, h));
EXPECT_EQ(2u, h.step_); EXPECT_EQ(2u, h.step_);
EXPECT_TRUE(reader.Parse<parseFlags>(s, h)); EXPECT_TRUE(reader.Parse<parseFlags>(s, h));
EXPECT_EQ(4u, h.step_); EXPECT_EQ(4u, h.step_);
EXPECT_EQ('a', s.Peek()); EXPECT_EQ(' ', s.Take());
EXPECT_EQ('a', s.Take());
} }
TEST(Reader, Parse_MultipleRoot) { TEST(Reader, Parse_MultipleRoot) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment