aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers.Test/TextFormatTest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ProtocolBuffers.Test/TextFormatTest.cs')
-rw-r--r--src/ProtocolBuffers.Test/TextFormatTest.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ProtocolBuffers.Test/TextFormatTest.cs b/src/ProtocolBuffers.Test/TextFormatTest.cs
index 2cdd9ce2..37a4192a 100644
--- a/src/ProtocolBuffers.Test/TextFormatTest.cs
+++ b/src/ProtocolBuffers.Test/TextFormatTest.cs
@@ -100,6 +100,20 @@ namespace Google.ProtocolBuffers
}
/// <summary>
+ /// Tests that a builder prints the same way as a message.
+ /// </summary>
+ [TestMethod]
+ public void PrintBuilder()
+ {
+ TestUtil.TestInMultipleCultures(() =>
+ {
+ string messageText = TextFormat.PrintToString(TestUtil.GetAllSet());
+ string builderText = TextFormat.PrintToString(TestUtil.GetAllSet().ToBuilder());
+ Assert.AreEqual(messageText, builderText);
+ });
+ }
+
+ /// <summary>
/// Print TestAllExtensions and compare with golden file.
/// </summary>
[TestMethod]