Index: runtime/vm/json_test.cc |
diff --git a/runtime/vm/json_test.cc b/runtime/vm/json_test.cc |
index 245bdd681e201fe1cffeeb887245523853f54c01..985b547592b1428db3841ac11fd52a257de41264 100644 |
--- a/runtime/vm/json_test.cc |
+++ b/runtime/vm/json_test.cc |
@@ -236,9 +236,22 @@ TEST_CASE(JSON_JSONStream_DartString) { |
JSONStream js; |
{ |
JSONObject jsobj(&js); |
- jsobj.AddPropertyStr("ascci", obj);; |
+ EXPECT(!jsobj.AddPropertyStr("ascii", obj)); |
} |
- EXPECT_STREQ("{\"ascci\":\"Hello, World!\"}", js.ToCString()); |
+ EXPECT_STREQ("{\"ascii\":\"Hello, World!\"}", js.ToCString()); |
+ } |
+ |
+ { |
+ result = Dart_GetField(lib, NewString("ascii")); |
+ EXPECT_VALID(result); |
+ obj ^= Api::UnwrapHandle(result); |
+ |
+ JSONStream js; |
+ { |
+ JSONObject jsobj(&js); |
+ EXPECT(jsobj.AddPropertyStr("subrange", obj, 1, 4)); |
+ } |
+ EXPECT_STREQ("{\"subrange\":\"ello\"}", js.ToCString()); |
} |
{ |
@@ -249,7 +262,7 @@ TEST_CASE(JSON_JSONStream_DartString) { |
JSONStream js; |
{ |
JSONObject jsobj(&js); |
- jsobj.AddPropertyStr("unicode", obj); |
+ EXPECT(!jsobj.AddPropertyStr("unicode", obj)); |
} |
EXPECT_STREQ("{\"unicode\":\"\\u00CE\\u00F1\\u0163\\u00E9r\\u00F1\\u00E5" |
"\\u0163\\u00EE\\u00F6\\u00F1\\u00E5\\u013C\\u00EE\\u017E" |
@@ -264,7 +277,7 @@ TEST_CASE(JSON_JSONStream_DartString) { |
JSONStream js; |
{ |
JSONObject jsobj(&js); |
- jsobj.AddPropertyStr("surrogates", obj); |
+ EXPECT(!jsobj.AddPropertyStr("surrogates", obj)); |
} |
EXPECT_STREQ("{\"surrogates\":\"\\uD834\\uDD1E\\uD834\\uDD1E\\uD834\\uDD1E" |
"\\uD834\\uDD1E\\uD834\\uDD1E\"}", js.ToCString()); |
@@ -278,7 +291,7 @@ TEST_CASE(JSON_JSONStream_DartString) { |
JSONStream js; |
{ |
JSONObject jsobj(&js); |
- jsobj.AddPropertyStr("nullInMiddle", obj); |
+ EXPECT(!jsobj.AddPropertyStr("nullInMiddle", obj)); |
} |
EXPECT_STREQ("{\"nullInMiddle\":\"This has\\u0000 four words.\"}", |
js.ToCString()); |