summaryrefslogtreecommitdiffstats
path: root/core/tests
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2011-07-18 14:27:31 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-18 14:27:31 -0700
commit1a1d731c9cc0209570472a9c8b6e59da0b545968 (patch)
tree9bccbde9735eb71373e549d86f5a38c801e04b6a /core/tests
parent989571eeca547db5f8972560c2d45f00be92a327 (diff)
parent0fc0edfd273f9d92b9f9fe4f49382b11104f55f0 (diff)
downloadframeworks_base-1a1d731c9cc0209570472a9c8b6e59da0b545968.zip
frameworks_base-1a1d731c9cc0209570472a9c8b6e59da0b545968.tar.gz
frameworks_base-1a1d731c9cc0209570472a9c8b6e59da0b545968.tar.bz2
Merge "Always escape chars that JavaScript treats as newlines."
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/coretests/src/android/util/JsonWriterTest.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/tests/coretests/src/android/util/JsonWriterTest.java b/core/tests/coretests/src/android/util/JsonWriterTest.java
index b29e2fd..1239a3c 100644
--- a/core/tests/coretests/src/android/util/JsonWriterTest.java
+++ b/core/tests/coretests/src/android/util/JsonWriterTest.java
@@ -289,6 +289,15 @@ public final class JsonWriterTest extends TestCase {
+ "\"\\u0019\"]", stringWriter.toString());
}
+ public void testUnicodeLineBreaksEscaped() throws IOException {
+ StringWriter stringWriter = new StringWriter();
+ JsonWriter jsonWriter = new JsonWriter(stringWriter);
+ jsonWriter.beginArray();
+ jsonWriter.value("\u2028 \u2029");
+ jsonWriter.endArray();
+ assertEquals("[\"\\u2028 \\u2029\"]", stringWriter.toString());
+ }
+
public void testEmptyArray() throws IOException {
StringWriter stringWriter = new StringWriter();
JsonWriter jsonWriter = new JsonWriter(stringWriter);