Merge pull request #13 from google/AaronWebster-patch-1

Add additional test for UpdateFromText()
diff --git a/compiler/back_end/cpp/testcode/text_format_test.cc b/compiler/back_end/cpp/testcode/text_format_test.cc
index 7b78b56..7db6dc8 100644
--- a/compiler/back_end/cpp/testcode/text_format_test.cc
+++ b/compiler/back_end/cpp/testcode/text_format_test.cc
@@ -75,6 +75,23 @@
       "}",
       ::emboss::WriteToString(view.b(), ::emboss::MultilineText()));
 }
+  
+TEST(TextFormat, UpdateFromText) {
+  ::std::array<char, 2> values{};
+  const auto view = MakeVanillaView(&values);
+
+  ::emboss::UpdateFromText(view, "{ a: 1, b: 2 }");
+  EXPECT_EQ(view.a().Read(), 1);
+  EXPECT_EQ(view.b().Read(), 2);
+
+  ::emboss::UpdateFromText(view, "{ a: 3 }");
+  EXPECT_EQ(view.a().Read(), 3);
+  EXPECT_EQ(view.b().Read(), 2);
+
+  ::emboss::UpdateFromText(view, "{ b: 4 }");
+  EXPECT_EQ(view.a().Read(), 3);
+  EXPECT_EQ(view.b().Read(), 4);
+}
 
 }  // namespace
 }  // namespace test