Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: tests/coroutine/stack_overflow_test.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/coroutine/fiber_yield_test.dart ('k') | tests/coroutine/throw_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dartino 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:dartino';
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);
12 testRecursion(100); 12 testRecursion(100);
13 testRecursion(1000); 13 testRecursion(1000);
14 } 14 }
15 15
16 void testRecursion(n) { 16 void testRecursion(n) {
17 var co = new Coroutine(recurse); 17 var co = new Coroutine(recurse);
18 Expect.isTrue(co.isSuspended); 18 Expect.isTrue(co.isSuspended);
19 Expect.equals(42, co(n)); 19 Expect.equals(42, co(n));
20 Expect.equals(87, co(87)); 20 Expect.equals(87, co(87));
21 Expect.equals(99, co(42)); 21 Expect.equals(99, co(42));
22 Expect.isTrue(co.isDone); 22 Expect.isTrue(co.isDone);
23 } 23 }
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 }
OLDNEW
« no previous file with comments | « tests/coroutine/fiber_yield_test.dart ('k') | tests/coroutine/throw_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698