| 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 | 4 |
| 5 // Tests for basic functionality. | 5 // Tests for basic functionality. |
| 6 | 6 |
| 7 library basic_tests; | 7 library basic_tests; |
| 8 | 8 |
| 9 import 'js_backend_cps_ir_test.dart'; | 9 import 'js_backend_cps_ir_test.dart'; |
| 10 | 10 |
| 11 const List<TestEntry> tests = const [ | 11 const List<TestEntry> tests = const [ |
| 12 const TestEntry(""" |
| 13 foo(a, [b = "b"]) => b; |
| 14 bar(a, {b: "b", c: "c"}) => c; |
| 15 main() { |
| 16 foo(0); |
| 17 foo(0, 1); |
| 18 bar(0); |
| 19 bar(0, b: 1); |
| 20 bar(0, c: 1); |
| 21 bar(0, b: 1, c: 2); |
| 22 } |
| 23 """, |
| 24 """ |
| 25 function() { |
| 26 V.foo(0, "b"); |
| 27 V.foo(0, 1); |
| 28 V.bar(0, "b", "c"); |
| 29 V.bar(0, 1, "c"); |
| 30 V.bar(0, "b", 1); |
| 31 V.bar(0, 1, 2); |
| 32 return null; |
| 33 }"""), |
| 12 const TestEntry( | 34 const TestEntry( |
| 13 """ | 35 """ |
| 14 foo(a) { | 36 foo(a) { |
| 15 return a; | 37 return a; |
| 16 } | 38 } |
| 17 main() { | 39 main() { |
| 18 var a = 10; | 40 var a = 10; |
| 19 var b = 1; | 41 var b = 1; |
| 20 var t; | 42 var t; |
| 21 t = a; | 43 t = a; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 46 """function() { | 68 """function() { |
| 47 return V.foo(); | 69 return V.foo(); |
| 48 }"""), | 70 }"""), |
| 49 const TestEntry("main() {}"), | 71 const TestEntry("main() {}"), |
| 50 const TestEntry("main() { return 42; }"), | 72 const TestEntry("main() { return 42; }"), |
| 51 const TestEntry("main() { return; }", """ | 73 const TestEntry("main() { return; }", """ |
| 52 function() { | 74 function() { |
| 53 return null; | 75 return null; |
| 54 }"""), | 76 }"""), |
| 55 ]; | 77 ]; |
| OLD | NEW |