Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: test/codegen_expected/lib/convert/json_lib_test.js

Issue 2211293002: Reify type params on map literals (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Remove unnecessary null check Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 dart_library.library('lib/convert/json_lib_test', null, /* Imports */[ 1 dart_library.library('lib/convert/json_lib_test', null, /* Imports */[
2 'dart_sdk', 2 'dart_sdk',
3 'unittest' 3 'unittest'
4 ], function load__json_lib_test(exports, dart_sdk, unittest) { 4 ], function load__json_lib_test(exports, dart_sdk, unittest) {
5 'use strict'; 5 'use strict';
6 const core = dart_sdk.core; 6 const core = dart_sdk.core;
7 const convert = dart_sdk.convert; 7 const convert = dart_sdk.convert;
8 const _interceptors = dart_sdk._interceptors; 8 const _interceptors = dart_sdk._interceptors;
9 const dart = dart_sdk.dart; 9 const dart = dart_sdk.dart;
10 const dartx = dart_sdk.dartx; 10 const dartx = dart_sdk.dartx;
11 const unittest$ = unittest.unittest; 11 const unittest$ = unittest.unittest;
12 const src__matcher__expect = unittest.src__matcher__expect; 12 const src__matcher__expect = unittest.src__matcher__expect;
13 const src__matcher__core_matchers = unittest.src__matcher__core_matchers; 13 const src__matcher__core_matchers = unittest.src__matcher__core_matchers;
14 const src__matcher__iterable_matchers = unittest.src__matcher__iterable_matche rs; 14 const src__matcher__iterable_matchers = unittest.src__matcher__iterable_matche rs;
15 const src__matcher__throws_matcher = unittest.src__matcher__throws_matcher; 15 const src__matcher__throws_matcher = unittest.src__matcher__throws_matcher;
16 const json_lib_test = Object.create(null); 16 const json_lib_test = Object.create(null);
17 let JSArrayOfObject = () => (JSArrayOfObject = dart.constFn(_interceptors.JSAr ray$(core.Object)))(); 17 let JSArrayOfObject = () => (JSArrayOfObject = dart.constFn(_interceptors.JSAr ray$(core.Object)))();
18 let JSArrayOfList = () => (JSArrayOfList = dart.constFn(_interceptors.JSArray$ (core.List)))(); 18 let JSArrayOfList = () => (JSArrayOfList = dart.constFn(_interceptors.JSArray$ (core.List)))();
19 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c ore.int)))(); 19 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c ore.int)))();
20 let ListOfObject = () => (ListOfObject = dart.constFn(core.List$(core.Object)) )(); 20 let ListOfObject = () => (ListOfObject = dart.constFn(core.List$(core.Object)) )();
21 let JSArrayOfListOfObject = () => (JSArrayOfListOfObject = dart.constFn(_inter ceptors.JSArray$(ListOfObject())))(); 21 let JSArrayOfListOfObject = () => (JSArrayOfListOfObject = dart.constFn(_inter ceptors.JSArray$(ListOfObject())))();
22 let MapOfString$dynamic = () => (MapOfString$dynamic = dart.constFn(core.Map$( core.String, dart.dynamic)))();
22 let JSArrayOfMap = () => (JSArrayOfMap = dart.constFn(_interceptors.JSArray$(c ore.Map)))(); 23 let JSArrayOfMap = () => (JSArrayOfMap = dart.constFn(_interceptors.JSArray$(c ore.Map)))();
24 let MapOfString$int = () => (MapOfString$int = dart.constFn(core.Map$(core.Str ing, core.int)))();
23 let JSArrayOfToJson = () => (JSArrayOfToJson = dart.constFn(_interceptors.JSAr ray$(json_lib_test.ToJson)))(); 25 let JSArrayOfToJson = () => (JSArrayOfToJson = dart.constFn(_interceptors.JSAr ray$(json_lib_test.ToJson)))();
24 let isInstanceOfOfJsonUnsupportedObjectError = () => (isInstanceOfOfJsonUnsupp ortedObjectError = dart.constFn(src__matcher__core_matchers.isInstanceOf$(conver t.JsonUnsupportedObjectError)))(); 26 let isInstanceOfOfJsonUnsupportedObjectError = () => (isInstanceOfOfJsonUnsupp ortedObjectError = dart.constFn(src__matcher__core_matchers.isInstanceOf$(conver t.JsonUnsupportedObjectError)))();
25 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))(); 27 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))();
26 let VoidToString = () => (VoidToString = dart.constFn(dart.definiteFunctionTyp e(core.String, [])))(); 28 let VoidToString = () => (VoidToString = dart.constFn(dart.definiteFunctionTyp e(core.String, [])))();
27 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun ctionType(dart.dynamic, [dart.dynamic])))(); 29 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun ctionType(dart.dynamic, [dart.dynamic])))();
28 json_lib_test.main = function() { 30 json_lib_test.main = function() {
29 unittest$.test('Parse', dart.fn(() => { 31 unittest$.test('Parse', dart.fn(() => {
30 src__matcher__expect.expect(convert.JSON.decode(' 5 '), src__matcher__core _matchers.equals(5)); 32 src__matcher__expect.expect(convert.JSON.decode(' 5 '), src__matcher__core _matchers.equals(5));
31 src__matcher__expect.expect(convert.JSON.decode(' -42 '), src__matcher__co re_matchers.equals(-42)); 33 src__matcher__expect.expect(convert.JSON.decode(' -42 '), src__matcher__co re_matchers.equals(-42));
32 src__matcher__expect.expect(convert.JSON.decode(' 3e0 '), src__matcher__co re_matchers.equals(3)); 34 src__matcher__expect.expect(convert.JSON.decode(' 3e0 '), src__matcher__co re_matchers.equals(3));
33 src__matcher__expect.expect(convert.JSON.decode(' 3.14 '), src__matcher__c ore_matchers.equals(3.14)); 35 src__matcher__expect.expect(convert.JSON.decode(' 3.14 '), src__matcher__c ore_matchers.equals(3.14));
34 src__matcher__expect.expect(convert.JSON.decode('true '), src__matcher__co re_matchers.isTrue); 36 src__matcher__expect.expect(convert.JSON.decode('true '), src__matcher__co re_matchers.isTrue);
35 src__matcher__expect.expect(convert.JSON.decode(' false'), src__matcher__c ore_matchers.isFalse); 37 src__matcher__expect.expect(convert.JSON.decode(' false'), src__matcher__c ore_matchers.isFalse);
36 src__matcher__expect.expect(convert.JSON.decode(' null '), src__matcher__c ore_matchers.isNull); 38 src__matcher__expect.expect(convert.JSON.decode(' null '), src__matcher__c ore_matchers.isNull);
37 src__matcher__expect.expect(convert.JSON.decode('\n\rnull\t'), src__matche r__core_matchers.isNull); 39 src__matcher__expect.expect(convert.JSON.decode('\n\rnull\t'), src__matche r__core_matchers.isNull);
38 src__matcher__expect.expect(convert.JSON.decode(' "hi there\\" bob" '), sr c__matcher__core_matchers.equals('hi there" bob')); 40 src__matcher__expect.expect(convert.JSON.decode(' "hi there\\" bob" '), sr c__matcher__core_matchers.equals('hi there" bob'));
39 src__matcher__expect.expect(convert.JSON.decode(' "" '), src__matcher__cor e_matchers.isEmpty); 41 src__matcher__expect.expect(convert.JSON.decode(' "" '), src__matcher__cor e_matchers.isEmpty);
40 src__matcher__expect.expect(convert.JSON.decode(' [] '), src__matcher__cor e_matchers.isEmpty); 42 src__matcher__expect.expect(convert.JSON.decode(' [] '), src__matcher__cor e_matchers.isEmpty);
41 src__matcher__expect.expect(convert.JSON.decode('[ ]'), src__matcher__core _matchers.isEmpty); 43 src__matcher__expect.expect(convert.JSON.decode('[ ]'), src__matcher__core _matchers.isEmpty);
42 src__matcher__expect.expect(convert.JSON.decode(' [3, -4.5, true, "hi", fa lse] '), src__matcher__core_matchers.equals(JSArrayOfObject().of([3, -4.5, true, 'hi', false]))); 44 src__matcher__expect.expect(convert.JSON.decode(' [3, -4.5, true, "hi", fa lse] '), src__matcher__core_matchers.equals(JSArrayOfObject().of([3, -4.5, true, 'hi', false])));
43 src__matcher__expect.expect(convert.JSON.decode('[null]'), src__matcher__i terable_matchers.orderedEquals([null])); 45 src__matcher__expect.expect(convert.JSON.decode('[null]'), src__matcher__i terable_matchers.orderedEquals([null]));
44 src__matcher__expect.expect(convert.JSON.decode(' [3, -4.5, null, true, "h i", false] '), src__matcher__core_matchers.equals(JSArrayOfObject().of([3, -4.5, null, true, 'hi', false]))); 46 src__matcher__expect.expect(convert.JSON.decode(' [3, -4.5, null, true, "h i", false] '), src__matcher__core_matchers.equals(JSArrayOfObject().of([3, -4.5, null, true, 'hi', false])));
45 src__matcher__expect.expect(convert.JSON.decode('[[null]]'), src__matcher_ _core_matchers.equals(JSArrayOfList().of([[null]]))); 47 src__matcher__expect.expect(convert.JSON.decode('[[null]]'), src__matcher_ _core_matchers.equals(JSArrayOfList().of([[null]])));
46 src__matcher__expect.expect(convert.JSON.decode(' [ [3], [], [null], ["hi" , true]] '), src__matcher__core_matchers.equals(JSArrayOfListOfObject().of([JSAr rayOfint().of([3]), [], [null], JSArrayOfObject().of(['hi', true])]))); 48 src__matcher__expect.expect(convert.JSON.decode(' [ [3], [], [null], ["hi" , true]] '), src__matcher__core_matchers.equals(JSArrayOfListOfObject().of([JSAr rayOfint().of([3]), [], [null], JSArrayOfObject().of(['hi', true])])));
47 src__matcher__expect.expect(convert.JSON.decode(' {} '), src__matcher__cor e_matchers.isEmpty); 49 src__matcher__expect.expect(convert.JSON.decode(' {} '), src__matcher__cor e_matchers.isEmpty);
48 src__matcher__expect.expect(convert.JSON.decode('{ }'), src__matcher__core _matchers.isEmpty); 50 src__matcher__expect.expect(convert.JSON.decode('{ }'), src__matcher__core _matchers.isEmpty);
49 src__matcher__expect.expect(convert.JSON.decode(' {"x":3, "y": -4.5, "z" : "hi","u" : true, "v": false } '), src__matcher__core_matchers.equals(dart.map( {x: 3, y: -4.5, z: "hi", u: true, v: false}))); 51 src__matcher__expect.expect(convert.JSON.decode(' {"x":3, "y": -4.5, "z" : "hi","u" : true, "v": false } '), src__matcher__core_matchers.equals(dart.map( {x: 3, y: -4.5, z: "hi", u: true, v: false}, core.String, core.Object)));
50 src__matcher__expect.expect(convert.JSON.decode(' {"x":3, "y": -4.5, "z" : "hi" } '), src__matcher__core_matchers.equals(dart.map({x: 3, y: -4.5, z: "hi" }))); 52 src__matcher__expect.expect(convert.JSON.decode(' {"x":3, "y": -4.5, "z" : "hi" } '), src__matcher__core_matchers.equals(dart.map({x: 3, y: -4.5, z: "hi" }, core.String, core.Object)));
51 src__matcher__expect.expect(convert.JSON.decode(' {"y": -4.5, "z" : "hi" ,"x":3 } '), src__matcher__core_matchers.equals(dart.map({y: -4.5, z: "hi", x: 3 }))); 53 src__matcher__expect.expect(convert.JSON.decode(' {"y": -4.5, "z" : "hi" ,"x":3 } '), src__matcher__core_matchers.equals(dart.map({y: -4.5, z: "hi", x: 3 }, core.String, core.Object)));
52 src__matcher__expect.expect(convert.JSON.decode('{ " hi bob " :3, "": 4.5} '), src__matcher__core_matchers.equals(dart.map({" hi bob ": 3, "": 4.5}))); 54 src__matcher__expect.expect(convert.JSON.decode('{ " hi bob " :3, "": 4.5} '), src__matcher__core_matchers.equals(dart.map({" hi bob ": 3, "": 4.5}, core.S tring, core.num)));
53 src__matcher__expect.expect(convert.JSON.decode(' { "x" : { } } '), src__m atcher__core_matchers.equals(dart.map({x: dart.map()}))); 55 src__matcher__expect.expect(convert.JSON.decode(' { "x" : { } } '), src__m atcher__core_matchers.equals(dart.map({x: dart.map()}, core.String, core.Map)));
54 src__matcher__expect.expect(convert.JSON.decode('{"x":{}}'), src__matcher_ _core_matchers.equals(dart.map({x: dart.map()}))); 56 src__matcher__expect.expect(convert.JSON.decode('{"x":{}}'), src__matcher_ _core_matchers.equals(dart.map({x: dart.map()}, core.String, core.Map)));
55 src__matcher__expect.expect(convert.JSON.decode('{"w":null}'), src__matche r__core_matchers.equals(dart.map({w: null}))); 57 src__matcher__expect.expect(convert.JSON.decode('{"w":null}'), src__matche r__core_matchers.equals(dart.map({w: null}, core.String, dart.dynamic)));
56 src__matcher__expect.expect(convert.JSON.decode('{"x":{"w":null}}'), src__ matcher__core_matchers.equals(dart.map({x: dart.map({w: null})}))); 58 src__matcher__expect.expect(convert.JSON.decode('{"x":{"w":null}}'), src__ matcher__core_matchers.equals(dart.map({x: dart.map({w: null}, core.String, dart .dynamic)}, core.String, MapOfString$dynamic())));
57 src__matcher__expect.expect(convert.JSON.decode(' {"x":3, "y": -4.5, "z" : "hi",' + '"w":null, "u" : true, "v": false } '), src__matcher__core_matchers.e quals(dart.map({x: 3, y: -4.5, z: "hi", w: null, u: true, v: false}))); 59 src__matcher__expect.expect(convert.JSON.decode(' {"x":3, "y": -4.5, "z" : "hi",' + '"w":null, "u" : true, "v": false } '), src__matcher__core_matchers.e quals(dart.map({x: 3, y: -4.5, z: "hi", w: null, u: true, v: false}, core.String , core.Object)));
58 src__matcher__expect.expect(convert.JSON.decode('{"x": {"a":3, "b": -4.5}, "y":[{}], ' + '"z":"hi","w":{"c":null,"d":true}, "v":null}'), src__matcher__cor e_matchers.equals(dart.map({x: dart.map({a: 3, b: -4.5}), y: JSArrayOfMap().of([ dart.map()]), z: "hi", w: dart.map({c: null, d: true}), v: null}))); 60 src__matcher__expect.expect(convert.JSON.decode('{"x": {"a":3, "b": -4.5}, "y":[{}], ' + '"z":"hi","w":{"c":null,"d":true}, "v":null}'), src__matcher__cor e_matchers.equals(dart.map({x: dart.map({a: 3, b: -4.5}, core.String, core.num), y: JSArrayOfMap().of([dart.map()]), z: "hi", w: dart.map({c: null, d: true}, co re.String, core.bool), v: null}, core.String, core.Object)));
59 }, VoidTodynamic())); 61 }, VoidTodynamic()));
60 unittest$.test('stringify', dart.fn(() => { 62 unittest$.test('stringify', dart.fn(() => {
61 src__matcher__expect.expect(convert.JSON.encode(5), src__matcher__core_mat chers.equals('5')); 63 src__matcher__expect.expect(convert.JSON.encode(5), src__matcher__core_mat chers.equals('5'));
62 src__matcher__expect.expect(convert.JSON.encode(-42), src__matcher__core_m atchers.equals('-42')); 64 src__matcher__expect.expect(convert.JSON.encode(-42), src__matcher__core_m atchers.equals('-42'));
63 json_lib_test.validateRoundTrip(3.14); 65 json_lib_test.validateRoundTrip(3.14);
64 src__matcher__expect.expect(convert.JSON.encode(true), src__matcher__core_ matchers.equals('true')); 66 src__matcher__expect.expect(convert.JSON.encode(true), src__matcher__core_ matchers.equals('true'));
65 src__matcher__expect.expect(convert.JSON.encode(false), src__matcher__core _matchers.equals('false')); 67 src__matcher__expect.expect(convert.JSON.encode(false), src__matcher__core _matchers.equals('false'));
66 src__matcher__expect.expect(convert.JSON.encode(null), src__matcher__core_ matchers.equals('null')); 68 src__matcher__expect.expect(convert.JSON.encode(null), src__matcher__core_ matchers.equals('null'));
67 src__matcher__expect.expect(convert.JSON.encode(' hi there" bob '), src__m atcher__core_matchers.equals('" hi there\\" bob "')); 69 src__matcher__expect.expect(convert.JSON.encode(' hi there" bob '), src__m atcher__core_matchers.equals('" hi there\\" bob "'));
68 src__matcher__expect.expect(convert.JSON.encode('hi\\there'), src__matcher __core_matchers.equals('"hi\\\\there"')); 70 src__matcher__expect.expect(convert.JSON.encode('hi\\there'), src__matcher __core_matchers.equals('"hi\\\\there"'));
69 src__matcher__expect.expect(convert.JSON.encode('hi\nthere'), src__matcher __core_matchers.equals('"hi\\nthere"')); 71 src__matcher__expect.expect(convert.JSON.encode('hi\nthere'), src__matcher __core_matchers.equals('"hi\\nthere"'));
70 src__matcher__expect.expect(convert.JSON.encode('hi\r\nthere'), src__match er__core_matchers.equals('"hi\\r\\nthere"')); 72 src__matcher__expect.expect(convert.JSON.encode('hi\r\nthere'), src__match er__core_matchers.equals('"hi\\r\\nthere"'));
71 src__matcher__expect.expect(convert.JSON.encode(''), src__matcher__core_ma tchers.equals('""')); 73 src__matcher__expect.expect(convert.JSON.encode(''), src__matcher__core_ma tchers.equals('""'));
72 src__matcher__expect.expect(convert.JSON.encode([]), src__matcher__core_ma tchers.equals('[]')); 74 src__matcher__expect.expect(convert.JSON.encode([]), src__matcher__core_ma tchers.equals('[]'));
73 src__matcher__expect.expect(convert.JSON.encode(core.List.new(0)), src__ma tcher__core_matchers.equals('[]')); 75 src__matcher__expect.expect(convert.JSON.encode(core.List.new(0)), src__ma tcher__core_matchers.equals('[]'));
74 src__matcher__expect.expect(convert.JSON.encode(core.List.new(3)), src__ma tcher__core_matchers.equals('[null,null,null]')); 76 src__matcher__expect.expect(convert.JSON.encode(core.List.new(3)), src__ma tcher__core_matchers.equals('[null,null,null]'));
75 json_lib_test.validateRoundTrip(JSArrayOfObject().of([3, -4.5, null, true, 'hi', false])); 77 json_lib_test.validateRoundTrip(JSArrayOfObject().of([3, -4.5, null, true, 'hi', false]));
76 src__matcher__expect.expect(convert.JSON.encode(JSArrayOfListOfObject().of ([JSArrayOfint().of([3]), [], [null], JSArrayOfObject().of(['hi', true])])), src __matcher__core_matchers.equals('[[3],[],[null],["hi",true]]')); 78 src__matcher__expect.expect(convert.JSON.encode(JSArrayOfListOfObject().of ([JSArrayOfint().of([3]), [], [null], JSArrayOfObject().of(['hi', true])])), src __matcher__core_matchers.equals('[[3],[],[null],["hi",true]]'));
77 src__matcher__expect.expect(convert.JSON.encode(dart.map()), src__matcher_ _core_matchers.equals('{}')); 79 src__matcher__expect.expect(convert.JSON.encode(dart.map()), src__matcher_ _core_matchers.equals('{}'));
78 src__matcher__expect.expect(convert.JSON.encode(core.Map.new()), src__matc her__core_matchers.equals('{}')); 80 src__matcher__expect.expect(convert.JSON.encode(core.Map.new()), src__matc her__core_matchers.equals('{}'));
79 src__matcher__expect.expect(convert.JSON.encode(dart.map({x: dart.map()})) , src__matcher__core_matchers.equals('{"x":{}}')); 81 src__matcher__expect.expect(convert.JSON.encode(dart.map({x: dart.map()}, core.String, core.Map)), src__matcher__core_matchers.equals('{"x":{}}'));
80 src__matcher__expect.expect(convert.JSON.encode(dart.map({x: dart.map({a: 3})})), src__matcher__core_matchers.equals('{"x":{"a":3}}')); 82 src__matcher__expect.expect(convert.JSON.encode(dart.map({x: dart.map({a: 3}, core.String, core.int)}, core.String, MapOfString$int())), src__matcher__cor e_matchers.equals('{"x":{"a":3}}'));
81 json_lib_test.validateRoundTrip(dart.map({x: 3, y: -4.5, z: 'hi', w: null, u: true, v: false})); 83 json_lib_test.validateRoundTrip(dart.map({x: 3, y: -4.5, z: 'hi', w: null, u: true, v: false}, core.String, core.Object));
82 json_lib_test.validateRoundTrip(dart.map({x: 3, y: -4.5, z: 'hi'})); 84 json_lib_test.validateRoundTrip(dart.map({x: 3, y: -4.5, z: 'hi'}, core.St ring, core.Object));
83 json_lib_test.validateRoundTrip(dart.map({' hi bob ': 3, '': 4.5})); 85 json_lib_test.validateRoundTrip(dart.map({' hi bob ': 3, '': 4.5}, core.St ring, core.num));
84 json_lib_test.validateRoundTrip(dart.map({x: dart.map({a: 3, b: -4.5}), y: JSArrayOfMap().of([dart.map()]), z: 'hi', w: dart.map({c: null, d: true}), v: n ull})); 86 json_lib_test.validateRoundTrip(dart.map({x: dart.map({a: 3, b: -4.5}, cor e.String, core.num), y: JSArrayOfMap().of([dart.map()]), z: 'hi', w: dart.map({c : null, d: true}, core.String, core.bool), v: null}, core.String, core.Object));
85 src__matcher__expect.expect(convert.JSON.encode(new json_lib_test.ToJson(4 )), "4"); 87 src__matcher__expect.expect(convert.JSON.encode(new json_lib_test.ToJson(4 )), "4");
86 src__matcher__expect.expect(convert.JSON.encode(new json_lib_test.ToJson(J SArrayOfObject().of([4, "a"]))), '[4,"a"]'); 88 src__matcher__expect.expect(convert.JSON.encode(new json_lib_test.ToJson(J SArrayOfObject().of([4, "a"]))), '[4,"a"]');
87 src__matcher__expect.expect(convert.JSON.encode(new json_lib_test.ToJson(J SArrayOfObject().of([4, new json_lib_test.ToJson(dart.map({x: 42}))]))), '[4,{"x ":42}]'); 89 src__matcher__expect.expect(convert.JSON.encode(new json_lib_test.ToJson(J SArrayOfObject().of([4, new json_lib_test.ToJson(dart.map({x: 42}, core.String, core.int))]))), '[4,{"x":42}]');
88 src__matcher__expect.expect(dart.fn(() => { 90 src__matcher__expect.expect(dart.fn(() => {
89 convert.JSON.encode(JSArrayOfToJson().of([new json_lib_test.ToJson(new j son_lib_test.ToJson(4))])); 91 convert.JSON.encode(JSArrayOfToJson().of([new json_lib_test.ToJson(new j son_lib_test.ToJson(4))]));
90 }, VoidTodynamic()), json_lib_test.throwsJsonError); 92 }, VoidTodynamic()), json_lib_test.throwsJsonError);
91 src__matcher__expect.expect(dart.fn(() => { 93 src__matcher__expect.expect(dart.fn(() => {
92 convert.JSON.encode(JSArrayOfObject().of([new core.Object()])); 94 convert.JSON.encode(JSArrayOfObject().of([new core.Object()]));
93 }, VoidTodynamic()), json_lib_test.throwsJsonError); 95 }, VoidTodynamic()), json_lib_test.throwsJsonError);
94 }, VoidTodynamic())); 96 }, VoidTodynamic()));
95 unittest$.test('stringify throws if argument cannot be converted', dart.fn(( ) => { 97 unittest$.test('stringify throws if argument cannot be converted', dart.fn(( ) => {
96 src__matcher__expect.expect(dart.fn(() => convert.JSON.encode(new json_lib _test.TestClass()), VoidToString()), json_lib_test.throwsJsonError); 98 src__matcher__expect.expect(dart.fn(() => convert.JSON.encode(new json_lib _test.TestClass()), VoidToString()), json_lib_test.throwsJsonError);
97 }, VoidTodynamic())); 99 }, VoidTodynamic()));
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 }, 156 },
155 set throwsJsonError(_) {} 157 set throwsJsonError(_) {}
156 }); 158 });
157 json_lib_test.validateRoundTrip = function(expected) { 159 json_lib_test.validateRoundTrip = function(expected) {
158 src__matcher__expect.expect(convert.JSON.decode(convert.JSON.encode(expected )), src__matcher__core_matchers.equals(expected)); 160 src__matcher__expect.expect(convert.JSON.decode(convert.JSON.encode(expected )), src__matcher__core_matchers.equals(expected));
159 }; 161 };
160 dart.fn(json_lib_test.validateRoundTrip, dynamicTodynamic()); 162 dart.fn(json_lib_test.validateRoundTrip, dynamicTodynamic());
161 // Exports: 163 // Exports:
162 exports.json_lib_test = json_lib_test; 164 exports.json_lib_test = json_lib_test;
163 }); 165 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698