aboutsummaryrefslogtreecommitdiffhomepage
path: root/java/core/src/test/java/com/google/protobuf/TextFormatTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/core/src/test/java/com/google/protobuf/TextFormatTest.java')
-rw-r--r--java/core/src/test/java/com/google/protobuf/TextFormatTest.java17
1 files changed, 7 insertions, 10 deletions
diff --git a/java/core/src/test/java/com/google/protobuf/TextFormatTest.java b/java/core/src/test/java/com/google/protobuf/TextFormatTest.java
index 5d38ca51..720061d2 100644
--- a/java/core/src/test/java/com/google/protobuf/TextFormatTest.java
+++ b/java/core/src/test/java/com/google/protobuf/TextFormatTest.java
@@ -61,12 +61,11 @@ import junit.framework.TestCase;
public class TextFormatTest extends TestCase {
// A basic string with different escapable characters for testing.
- private final static String kEscapeTestString =
- "\"A string with ' characters \n and \r newlines and \t tabs and \001 "
- + "slashes \\";
+ private static final String ESCAPE_TEST_STRING =
+ "\"A string with ' characters \n and \r newlines and \t tabs and \001 " + "slashes \\";
// A representation of the above string with all the characters escaped.
- private final static String kEscapeTestStringEscaped =
+ private static final String ESCAPE_TEST_STRING_ESCAPED =
"\\\"A string with \\' characters \\n and \\r newlines "
+ "and \\t tabs and \\001 slashes \\\\";
@@ -576,10 +575,10 @@ public class TextFormatTest extends TestCase {
"integer: 82301481290849012385230157",
"optional_int32: 82301481290849012385230157");
assertParseError(
- "1:16: Expected \"true\" or \"false\".",
+ "1:16: Expected \"true\" or \"false\". Found \"maybe\".",
"optional_bool: maybe");
assertParseError(
- "1:16: Expected \"true\" or \"false\".",
+ "1:16: Expected \"true\" or \"false\". Found \"2\".",
"optional_bool: 2");
assertParseError(
"1:18: Expected string.",
@@ -643,10 +642,8 @@ public class TextFormatTest extends TestCase {
TextFormat.unescapeBytes("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\""));
assertEquals("\0\001\007\b\f\n\r\t\013\\\'\"",
TextFormat.unescapeText("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\""));
- assertEquals(kEscapeTestStringEscaped,
- TextFormat.escapeText(kEscapeTestString));
- assertEquals(kEscapeTestString,
- TextFormat.unescapeText(kEscapeTestStringEscaped));
+ assertEquals(ESCAPE_TEST_STRING_ESCAPED, TextFormat.escapeText(ESCAPE_TEST_STRING));
+ assertEquals(ESCAPE_TEST_STRING, TextFormat.unescapeText(ESCAPE_TEST_STRING_ESCAPED));
// Invariant
assertEquals("hello",