OLD | NEW |
1 // Copyright (c) 2014, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 import 'dart:fletch'; | 5 import 'dart:fletch'; |
6 | 6 |
7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
8 | 8 |
9 main() { | 9 main() { |
10 testRecursion(0); | 10 testRecursion(0); |
11 testRecursion(10); | 11 testRecursion(10); |
(...skipping 12 matching lines...) Expand all Loading... |
24 | 24 |
25 int recurse(n) { | 25 int recurse(n) { |
26 if (n == 0) { | 26 if (n == 0) { |
27 Expect.equals(87, Coroutine.yield(42)); | 27 Expect.equals(87, Coroutine.yield(42)); |
28 Expect.equals(42, Coroutine.yield(87)); | 28 Expect.equals(42, Coroutine.yield(87)); |
29 return 99; | 29 return 99; |
30 } else { | 30 } else { |
31 return recurse(n - 1); | 31 return recurse(n - 1); |
32 } | 32 } |
33 } | 33 } |
OLD | NEW |