| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 // Helper to test compilation equivalence between source and .dill based | 5 // Helper to test compilation equivalence between source and .dill based |
| 6 // compilation. | 6 // compilation. |
| 7 library dart2js.kernel.compile_from_dill_test_helper; | 7 library dart2js.kernel.compile_from_dill_test_helper; |
| 8 | 8 |
| 9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 class B<Q, R> extends A<R, W<Q>> { | 170 class B<Q, R> extends A<R, W<Q>> { |
| 171 } | 171 } |
| 172 class C<Y> extends B<Y, W<Y>> { | 172 class C<Y> extends B<Y, W<Y>> { |
| 173 } | 173 } |
| 174 class W<Z> {} | 174 class W<Z> {} |
| 175 main() { | 175 main() { |
| 176 print(new C<String>().a); | 176 print(new C<String>().a); |
| 177 } | 177 } |
| 178 ''' | 178 ''' |
| 179 }, expectIdenticalOutput: true), | 179 }, expectIdenticalOutput: true), |
| 180 const Test(const { |
| 181 'main.dart': ''' |
| 182 class C<X> { |
| 183 const C(); |
| 184 } |
| 185 foo(x) { |
| 186 print(x.runtimeType); |
| 187 } |
| 188 main() { |
| 189 foo(<int>[]); |
| 190 foo(const <int>[]); |
| 191 foo(new C<String>()); |
| 192 foo(const C<String>()); |
| 193 foo(<Type>[C, String]); |
| 194 foo(const <Type>[C, String]); |
| 195 } |
| 196 ''' |
| 197 }, expectIdenticalOutput: true), |
| 180 ]; | 198 ]; |
| 181 | 199 |
| 182 enum ResultKind { crashes, errors, warnings, success, failure } | 200 enum ResultKind { crashes, errors, warnings, success, failure } |
| 183 | 201 |
| 184 const List<String> commonOptions = const <String>[ | 202 const List<String> commonOptions = const <String>[ |
| 185 Flags.disableTypeInference, | 203 Flags.disableTypeInference, |
| 186 Flags.disableInlining, | 204 Flags.disableInlining, |
| 187 Flags.enableAssertMessage | 205 Flags.enableAssertMessage |
| 188 ]; | 206 ]; |
| 189 | 207 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType]; | 358 Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType]; |
| 341 checkSets(map1.keys, map2.keys, 'output', equality); | 359 checkSets(map1.keys, map2.keys, 'output', equality); |
| 342 map1.forEach((String name, BufferedOutputSink output1) { | 360 map1.forEach((String name, BufferedOutputSink output1) { |
| 343 BufferedOutputSink output2 = map2[name]; | 361 BufferedOutputSink output2 = map2[name]; |
| 344 Expect.stringEquals(output1.text, output2.text); | 362 Expect.stringEquals(output1.text, output2.text); |
| 345 }); | 363 }); |
| 346 }); | 364 }); |
| 347 } | 365 } |
| 348 return ResultKind.success; | 366 return ResultKind.success; |
| 349 } | 367 } |
| OLD | NEW |