Index: third_party/protobuf/java/core/src/test/java/com/google/protobuf/TextFormatTest.java |
diff --git a/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TextFormatTest.java b/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TextFormatTest.java |
index 6a91b02f039f145a4f5fba795ccada1216cea632..63c17cd0fd19489d2c3d0edf025b0d4b8841b982 100644 |
--- a/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TextFormatTest.java |
+++ b/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TextFormatTest.java |
@@ -42,9 +42,11 @@ import protobuf_unittest.UnittestProto.TestAllTypes.NestedMessage; |
import protobuf_unittest.UnittestProto.TestEmptyMessage; |
import protobuf_unittest.UnittestProto.TestOneof2; |
import proto2_wireformat_unittest.UnittestMsetWireFormat.TestMessageSet; |
+ |
+import junit.framework.TestCase; |
+ |
import java.io.StringReader; |
import java.util.List; |
-import junit.framework.TestCase; |
/** |
* Test case for {@link TextFormat}. |
@@ -520,16 +522,15 @@ public class TextFormatTest extends TestCase { |
"optional_string: \"ueoauaoe\n" + |
"optional_int32: 123"); |
assertParseError( |
- "1:2: Input contains unknown fields and/or extensions:\n" + |
- "1:2:\tprotobuf_unittest.TestAllTypes.[nosuchext]", |
+ "1:2: Extension \"nosuchext\" not found in the ExtensionRegistry.", |
"[nosuchext]: 123"); |
assertParseError( |
"1:20: Extension \"protobuf_unittest.optional_int32_extension\" does " + |
"not extend message type \"protobuf_unittest.TestAllTypes\".", |
"[protobuf_unittest.optional_int32_extension]: 123"); |
assertParseError( |
- "1:1: Input contains unknown fields and/or extensions:\n" + |
- "1:1:\tprotobuf_unittest.TestAllTypes.nosuchfield", |
+ "1:1: Message type \"protobuf_unittest.TestAllTypes\" has no field " + |
+ "named \"nosuchfield\".", |
"nosuchfield: 123"); |
assertParseError( |
"1:21: Expected \">\".", |
@@ -990,35 +991,10 @@ public class TextFormatTest extends TestCase { |
assertParseSuccessWithOverwriteForbidden("repeated_nested_message [{ bb: 1 }, { bb: 2 }]\n"); |
} |
- public void testParseShortRepeatedFormOfEmptyRepeatedFields() throws Exception { |
- assertParseSuccessWithOverwriteForbidden("repeated_foreign_enum: []"); |
- assertParseSuccessWithOverwriteForbidden("repeated_int32: []\n"); |
- assertParseSuccessWithOverwriteForbidden("RepeatedGroup []\n"); |
- assertParseSuccessWithOverwriteForbidden("repeated_nested_message []\n"); |
- } |
- |
- public void testParseShortRepeatedFormWithTrailingComma() throws Exception { |
- assertParseErrorWithOverwriteForbidden( |
- "1:38: Expected identifier. Found \']\'", |
- "repeated_foreign_enum: [FOREIGN_FOO, ]\n"); |
- assertParseErrorWithOverwriteForbidden( |
- "1:22: Couldn't parse integer: For input string: \"]\"", |
- "repeated_int32: [ 1, ]\n"); |
- assertParseErrorWithOverwriteForbidden( |
- "1:25: Expected \"{\".", |
- "RepeatedGroup [{ a: 1 },]\n"); |
- assertParseErrorWithOverwriteForbidden( |
- "1:37: Expected \"{\".", |
- "repeated_nested_message [{ bb: 1 }, ]\n"); |
- } |
- |
public void testParseShortRepeatedFormOfNonRepeatedFields() throws Exception { |
assertParseErrorWithOverwriteForbidden( |
"1:17: Couldn't parse integer: For input string: \"[\"", |
"optional_int32: [1]\n"); |
- assertParseErrorWithOverwriteForbidden( |
- "1:17: Couldn't parse integer: For input string: \"[\"", |
- "optional_int32: []\n"); |
} |
// ======================================================================= |