| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 // Tests for basic functionality. |
| 6 |
| 7 library basic_tests; |
| 8 |
| 9 import 'js_backend_cps_ir_test.dart'; |
| 10 |
| 11 const List<TestEntry> tests = const [ |
| 12 const TestEntry( |
| 13 """ |
| 14 foo(a) { |
| 15 return a; |
| 16 } |
| 17 main() { |
| 18 var a = 10; |
| 19 var b = 1; |
| 20 var t; |
| 21 t = a; |
| 22 a = b; |
| 23 b = t; |
| 24 print(a); |
| 25 print(b); |
| 26 print(b); |
| 27 print(foo(a)); |
| 28 } |
| 29 """, |
| 30 """ |
| 31 function() { |
| 32 var a, b; |
| 33 a = 10; |
| 34 b = 1; |
| 35 P.print(b); |
| 36 P.print(a); |
| 37 P.print(a); |
| 38 P.print(V.foo(b)); |
| 39 return null; |
| 40 }"""), |
| 41 const TestEntry( |
| 42 """ |
| 43 foo() { return 42; } |
| 44 main() { return foo(); } |
| 45 """, |
| 46 """function() { |
| 47 return V.foo(); |
| 48 }"""), |
| 49 const TestEntry("main() {}"), |
| 50 const TestEntry("main() { return 42; }"), |
| 51 const TestEntry("main() { return; }", """ |
| 52 function() { |
| 53 return null; |
| 54 }"""), |
| 55 ]; |
| OLD | NEW |