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 // VMOptions=--enable_async --optimization-counter-threshold=10 | |
6 | |
srdjan
2014/10/14 13:45:09
Maybe add a brief description why the test is need
Florian Schneider
2014/10/14 14:44:01
Done.
| |
7 import 'package:expect/expect.dart'; | |
8 | |
9 import 'dart:async'; | |
10 | |
11 check(value) { | |
12 try { | |
13 } finally { | |
14 return value; | |
15 } | |
16 } | |
17 | |
18 fail() { | |
19 try { | |
20 Expect.isTrue(false); | |
21 } finally { } | |
22 } | |
23 | |
24 foo(i) async { | |
25 var k = await 77; | |
26 var a = "abc${k}"; | |
27 if (a != "abc77") fail(); | |
28 return k; | |
29 } | |
30 | |
31 | |
32 main() { | |
33 for (int i = 0; i < 20; i++) { | |
34 foo(i).then((value) => Expect.equals(77, value)); | |
35 } | |
36 } | |
OLD | NEW |