OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 | 6 |
7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
8 import 'compiler_helper.dart'; | 8 import 'compiler_helper.dart'; |
9 import 'parser_helper.dart'; | 9 import 'parser_helper.dart'; |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 var typesInferrer = compiler.typesTask.typesInferrer; | 100 var typesInferrer = compiler.typesTask.typesInferrer; |
101 var element = findElement(compiler, name); | 101 var element = findElement(compiler, name); |
102 Expect.equals( | 102 Expect.equals( |
103 type, | 103 type, |
104 typesInferrer.getReturnTypeOfElement(element).simplify(compiler), | 104 typesInferrer.getReturnTypeOfElement(element).simplify(compiler), |
105 name); | 105 name); |
106 } | 106 } |
107 | 107 |
108 var compiler1 = compilerFor(TEST1, uri); | 108 var compiler1 = compilerFor(TEST1, uri); |
109 asyncTest(() => compiler1.runCompiler(uri).then((_) { | 109 asyncTest(() => compiler1.runCompiler(uri).then((_) { |
110 checkReturn(compiler1, 'test1', compiler1.typesTask.intType); | 110 checkReturn(compiler1, 'test1', compiler1.typesTask.uint31Type); |
111 checkReturn(compiler1, 'test2', | 111 checkReturn(compiler1, 'test2', |
112 compiler1.typesTask.dynamicType.nonNullable()); | 112 compiler1.typesTask.dynamicType.nonNullable()); |
113 checkReturn(compiler1, 'test3', compiler1.typesTask.intType); | 113 checkReturn(compiler1, 'test3', compiler1.typesTask.uint31Type); |
114 checkReturn(compiler1, 'test4', compiler1.typesTask.mapType); | 114 checkReturn(compiler1, 'test4', compiler1.typesTask.mapType); |
115 checkReturn(compiler1, 'test5', | 115 checkReturn(compiler1, 'test5', |
116 compiler1.typesTask.dynamicType.nonNullable()); | 116 compiler1.typesTask.dynamicType.nonNullable()); |
117 checkReturn(compiler1, 'test6', | 117 checkReturn(compiler1, 'test6', |
118 compiler1.typesTask.dynamicType.nonNullable()); | 118 compiler1.typesTask.dynamicType.nonNullable()); |
119 })); | 119 })); |
120 | 120 |
121 var compiler2 = compilerFor(TEST2, uri); | 121 var compiler2 = compilerFor(TEST2, uri); |
122 asyncTest(() => compiler2.runCompiler(uri).then((_) { | 122 asyncTest(() => compiler2.runCompiler(uri).then((_) { |
123 checkReturn(compiler2, 'test1', compiler2.typesTask.mapType.nonNullable()); | 123 checkReturn(compiler2, 'test1', compiler2.typesTask.mapType.nonNullable()); |
124 checkReturn(compiler2, 'test2', compiler2.typesTask.mapType); | 124 checkReturn(compiler2, 'test2', compiler2.typesTask.mapType); |
125 checkReturn(compiler2, 'test3', compiler2.typesTask.mapType); | 125 checkReturn(compiler2, 'test3', compiler2.typesTask.mapType); |
126 checkReturn(compiler2, 'test4', compiler2.typesTask.mapType); | 126 checkReturn(compiler2, 'test4', compiler2.typesTask.mapType); |
127 checkReturn(compiler2, 'test5', compiler2.typesTask.mapType); | 127 checkReturn(compiler2, 'test5', compiler2.typesTask.mapType); |
128 | 128 |
129 checkReturn(compiler2, 'test6', compiler2.typesTask.numType); | 129 checkReturn(compiler2, 'test6', compiler2.typesTask.numType); |
130 checkReturn(compiler2, 'test7', compiler2.typesTask.intType); | 130 checkReturn(compiler2, 'test7', compiler2.typesTask.uint31Type); |
131 checkReturn(compiler2, 'test8', compiler2.typesTask.intType); | 131 checkReturn(compiler2, 'test8', compiler2.typesTask.uint31Type); |
132 checkReturn(compiler2, 'test9', compiler2.typesTask.intType); | 132 checkReturn(compiler2, 'test9', compiler2.typesTask.uint31Type); |
133 checkReturn(compiler2, 'test10', compiler2.typesTask.numType); | 133 checkReturn(compiler2, 'test10', compiler2.typesTask.numType); |
134 checkReturn(compiler2, 'test11', compiler2.typesTask.doubleType); | 134 checkReturn(compiler2, 'test11', compiler2.typesTask.doubleType); |
135 })); | 135 })); |
136 } | 136 } |
OLD | NEW |