Commit 595b1142 authored by StilesCrisis's avatar StilesCrisis

Unit test

Add unit tests expecting an assertion when writing an object with a key
but no value.
parent 26e089b9
......@@ -442,6 +442,28 @@ TEST(Writer, InvalidEventSequence) {
EXPECT_THROW(writer.Int(1), AssertException);
EXPECT_FALSE(writer.IsComplete());
}
// { 'a' }
{
StringBuffer buffer;
Writer<StringBuffer> writer(buffer);
writer.StartObject();
writer.Key("a");
EXPECT_THROW(writer.EndObject(), AssertException);
EXPECT_FALSE(writer.IsComplete());
}
// { 'a':'b','c' }
{
StringBuffer buffer;
Writer<StringBuffer> writer(buffer);
writer.StartObject();
writer.Key("a");
writer.String("b");
writer.Key("c");
EXPECT_THROW(writer.EndObject(), AssertException);
EXPECT_FALSE(writer.IsComplete());
}
}
TEST(Writer, NaN) {
......
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