diff options
author | Adam Cozzette <acozzette@google.com> | 2018-03-13 16:37:29 -0700 |
---|---|---|
committer | Adam Cozzette <acozzette@google.com> | 2018-03-13 16:37:29 -0700 |
commit | 0400cca3236de1ca303af38bf81eab332d042b7c (patch) | |
tree | a8a9b19853f64567c96750a1c7d253926471daa5 /java/core/src/test/java/com/google/protobuf/TextFormatTest.java | |
parent | 96b535cc2f4f7b7e22a1b8622149f7c26a5a3f63 (diff) | |
download | protobuf-0400cca3236de1ca303af38bf81eab332d042b7c.tar.gz protobuf-0400cca3236de1ca303af38bf81eab332d042b7c.tar.bz2 protobuf-0400cca3236de1ca303af38bf81eab332d042b7c.zip |
Integrated internal changes from Google
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.java | 17 |
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", |