| 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 | 10 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 176 } |
| 177 ''' | 177 ''' |
| 178 }, expectIdenticalOutput: true), | 178 }, expectIdenticalOutput: true), |
| 179 const Test(const { | 179 const Test(const { |
| 180 'main.dart': ''' | 180 'main.dart': ''' |
| 181 class _Marker { const _Marker(); } | 181 class _Marker { const _Marker(); } |
| 182 const _MARKER = const _Marker(); | 182 const _MARKER = const _Marker(); |
| 183 class Thing<X> { | 183 class Thing<X> { |
| 184 Thing([length = _MARKER]); | 184 Thing([length = _MARKER]); |
| 185 } | 185 } |
| 186 foo(x) { |
| 187 print(new List(x).length); |
| 188 } |
| 186 main() { | 189 main() { |
| 187 print(new Thing<String>(100)); | 190 print(new Thing<String>(100)); |
| 191 |
| 192 print(new List()); |
| 193 print(new List(4)); |
| 194 foo(3); |
| 195 foo(4); |
| 188 } | 196 } |
| 189 ''' | 197 ''' |
| 190 }, expectIdenticalOutput: true), | 198 }, expectIdenticalOutput: true), |
| 191 ]; | 199 ]; |
| 192 | 200 |
| 193 enum ResultKind { crashes, errors, warnings, success, failure } | 201 enum ResultKind { crashes, errors, warnings, success, failure } |
| 194 | 202 |
| 195 const List<String> commonOptions = const <String>[ | 203 const List<String> commonOptions = const <String>[ |
| 196 Flags.disableTypeInference, | 204 Flags.disableTypeInference, |
| 197 Flags.disableInlining, | 205 Flags.disableInlining, |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType]; | 359 Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType]; |
| 352 checkSets(map1.keys, map2.keys, 'output', equality); | 360 checkSets(map1.keys, map2.keys, 'output', equality); |
| 353 map1.forEach((String name, BufferedOutputSink output1) { | 361 map1.forEach((String name, BufferedOutputSink output1) { |
| 354 BufferedOutputSink output2 = map2[name]; | 362 BufferedOutputSink output2 = map2[name]; |
| 355 Expect.stringEquals(output1.text, output2.text); | 363 Expect.stringEquals(output1.text, output2.text); |
| 356 }); | 364 }); |
| 357 }); | 365 }); |
| 358 } | 366 } |
| 359 return ResultKind.success; | 367 return ResultKind.success; |
| 360 } | 368 } |
| OLD | NEW |