Commit 52870ad8 authored by Brandon Cole's avatar Brandon Cole

Also make sure known fields come across as expected

parent 3d32de9b
......@@ -363,7 +363,8 @@ TEST_F(JsonUtilTest, TestParsingUnknownAnyFields) {
"{\n"
" \"value\": {\n"
" \"@type\": \"type.googleapis.com/proto3.TestMessage\",\n"
" \"unknown_field\": \"UNKOWN_VALUE\"\n"
" \"unknown_field\": \"UNKOWN_VALUE\",\n"
" \"string_value\": \"expected_value\"\n"
" }\n"
"}";
......@@ -373,6 +374,10 @@ TEST_F(JsonUtilTest, TestParsingUnknownAnyFields) {
options.ignore_unknown_fields = true;
EXPECT_TRUE(FromJson(input, &m, options));
TestMessage t;
EXPECT_TRUE(m.value().UnpackTo(&t));
EXPECT_EQ("expected_value", t.string_value());
}
TEST_F(JsonUtilTest, TestParsingUnknownEnumsProto2) {
......
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