| 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 operators. | 6 // Tests of operators. |
| 6 | 7 |
| 7 library operators_tests; | 8 library operators_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("main() { return true ? 42 : 'foo'; }"), | 13 const TestEntry("main() { return true ? 42 : 'foo'; }"), |
| 13 const TestEntry(""" | 14 const TestEntry(""" |
| 14 foo() => foo(); | 15 foo() => foo(); |
| 15 main() { | 16 main() { |
| 16 print(foo() ? "hello world" : "bad bad"); | 17 print(foo() ? "hello world" : "bad bad"); |
| 17 }""", | 18 }""", |
| 18 """function() { | 19 """function() { |
| 19 P.print(P.identical(V.foo(), true) ? "hello world" : "bad bad"); | 20 P.print(P.identical(V.foo(), true) ? "hello world" : "bad bad"); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 36 return null; | 37 return null; |
| 37 }"""), | 38 }"""), |
| 38 const TestEntry(""" | 39 const TestEntry(""" |
| 39 get foo => foo; | 40 get foo => foo; |
| 40 main() { print(foo || foo); }""", | 41 main() { print(foo || foo); }""", |
| 41 """function() { | 42 """function() { |
| 42 P.print(P.identical(V.foo(), true) || P.identical(V.foo(), true)); | 43 P.print(P.identical(V.foo(), true) || P.identical(V.foo(), true)); |
| 43 return null; | 44 return null; |
| 44 }"""), | 45 }"""), |
| 45 ]; | 46 ]; |
| 47 |
| 48 void main() { |
| 49 runTests(tests); |
| 50 } |
| OLD | NEW |