| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // VMOptions=-DUSE_CPS_IR=true |
| 4 | 5 |
| 5 // Tests of literals. | 6 // Tests of literals. |
| 6 | 7 |
| 7 library literals_tests; | 8 library literals_tests; |
| 8 | 9 |
| 9 import 'js_backend_cps_ir_test.dart'; | 10 import 'js_backend_cps_ir.dart'; |
| 10 | 11 |
| 11 const List<TestEntry> tests = const [ | 12 const List<TestEntry> tests = const [ |
| 12 const TestEntry(""" | 13 const TestEntry(""" |
| 13 main() { | 14 main() { |
| 14 print([]); | 15 print([]); |
| 15 print([1]); | 16 print([1]); |
| 16 print([1, 2]); | 17 print([1, 2]); |
| 17 print([1, [1, 2]]); | 18 print([1, [1, 2]]); |
| 18 print({}); | 19 print({}); |
| 19 print({1: 2}); | 20 print({1: 2}); |
| 20 print({[1, 2]: [3, 4]}); | 21 print({[1, 2]: [3, 4]}); |
| 21 } | 22 } |
| 22 """, | 23 """, |
| 23 r""" | 24 r""" |
| 24 function() { | 25 function() { |
| 25 P.print([]); | 26 P.print([]); |
| 26 P.print([1]); | 27 P.print([1]); |
| 27 P.print([1, 2]); | 28 P.print([1, 2]); |
| 28 P.print([1, [1, 2]]); | 29 P.print([1, [1, 2]]); |
| 29 P.print(P.LinkedHashMap_LinkedHashMap$_empty()); | 30 P.print(P.LinkedHashMap_LinkedHashMap$_empty()); |
| 30 P.print(P.LinkedHashMap_LinkedHashMap$_literal([1, 2])); | 31 P.print(P.LinkedHashMap_LinkedHashMap$_literal([1, 2])); |
| 31 P.print(P.LinkedHashMap_LinkedHashMap$_literal([[1, 2], [3, 4]])); | 32 P.print(P.LinkedHashMap_LinkedHashMap$_literal([[1, 2], [3, 4]])); |
| 32 return null; | 33 return null; |
| 33 }"""), | 34 }"""), |
| 34 ]; | 35 ]; |
| 36 |
| 37 void main() { |
| 38 runTests(tests); |
| 39 } |
| OLD | NEW |