| Index: tests/lib/convert/chunked_conversion_json_decode1_test.dart
|
| diff --git a/tests/lib/convert/chunked_conversion_json_decode1_test.dart b/tests/lib/convert/chunked_conversion_json_decode1_test.dart
|
| index 0ef8ff3a8350a2e47e9f9d1c3567622f9cce533d..646e1e9e8de6e92b37b3add5d946eff1e2542f15 100644
|
| --- a/tests/lib/convert/chunked_conversion_json_decode1_test.dart
|
| +++ b/tests/lib/convert/chunked_conversion_json_decode1_test.dart
|
| @@ -6,29 +6,56 @@ import "package:expect/expect.dart";
|
| import 'dart:convert';
|
|
|
| final TESTS = [
|
| - [ 5, '5' ],
|
| - [ -42, '-42' ],
|
| - [ 3.14, '3.14' ],
|
| - [ true, 'true' ],
|
| - [ false, 'false' ],
|
| - [ null, 'null' ],
|
| - [ 'quote"or\'', '"quote\\"or\'"' ],
|
| - [ '', '""' ],
|
| - [ [], "[]" ],
|
| - [ [3, -4.5, true, "hi", false], '[3,-4.5,true,"hi",false]' ],
|
| - [ [null], "[null]" ],
|
| - [ [[null]], "[[null]]" ],
|
| - [ [[3]], "[[3]]" ],
|
| - [ {}, "{}" ],
|
| - [ { "x": 3, "y": 4.5, "z": "hi", "u": true, "v": false },
|
| - '{"x":3,"y":4.5,"z":"hi","u":true,"v":false}' ],
|
| - [ { "x": null }, '{"x":null}' ],
|
| - [ { "x": {} }, '{"x":{}}' ],
|
| - // Note that -0.0 won't be treated the same in JS. The Json spec seems to
|
| - // allow it, though.
|
| - [ { "hi there": 499, "'":-0.0 }, '{"hi there":499,"\'":-0.0}' ],
|
| - [ r'\foo', r'"\\foo"' ],
|
| - ];
|
| + [5, '5'],
|
| + [-42, '-42'],
|
| + [3.14, '3.14'],
|
| + [true, 'true'],
|
| + [false, 'false'],
|
| + [null, 'null'],
|
| + ['quote"or\'', '"quote\\"or\'"'],
|
| + ['', '""'],
|
| + [[], "[]"],
|
| + [
|
| + [3, -4.5, true, "hi", false],
|
| + '[3,-4.5,true,"hi",false]'
|
| + ],
|
| + [
|
| + [null],
|
| + "[null]"
|
| + ],
|
| + [
|
| + [
|
| + [null]
|
| + ],
|
| + "[[null]]"
|
| + ],
|
| + [
|
| + [
|
| + [3]
|
| + ],
|
| + "[[3]]"
|
| + ],
|
| + [{}, "{}"],
|
| + [
|
| + {"x": 3, "y": 4.5, "z": "hi", "u": true, "v": false},
|
| + '{"x":3,"y":4.5,"z":"hi","u":true,"v":false}'
|
| + ],
|
| + [
|
| + {"x": null},
|
| + '{"x":null}'
|
| + ],
|
| + [
|
| + {"x": {}},
|
| + '{"x":{}}'
|
| + ],
|
| + // Note that -0.0 won't be treated the same in JS. The Json spec seems to
|
| + // allow it, though.
|
| + [
|
| + {"hi there": 499, "'": -0.0},
|
| + '{"hi there":499,"\'":-0.0}'
|
| + ],
|
| + [r'\foo', r'"\\foo"'],
|
| +];
|
|
|
| bool isJsonEqual(o1, o2) {
|
| if (o1 == o2) return true;
|
| @@ -135,17 +162,19 @@ Object decode7(String str) {
|
| return result;
|
| }
|
|
|
| -
|
| main() {
|
| var tests = TESTS.expand((test) {
|
| var object = test[0];
|
| var string = test[1];
|
| var longString = " "
|
| - " "
|
| - "$string"
|
| - " "
|
| - " ";
|
| - return [test, [object, longString]];
|
| + " "
|
| + "$string"
|
| + " "
|
| + " ";
|
| + return [
|
| + test,
|
| + [object, longString]
|
| + ];
|
| });
|
| for (var test in TESTS) {
|
| var o = test[0];
|
|
|