OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2017, 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 // VMOptions=--error_on_bad_type --error_on_bad_override --verbose_debug | |
5 | |
6 import 'dart:developer'; | |
7 import 'package:observatory/models.dart' as M; | |
8 import 'package:observatory/service_io.dart'; | |
9 import 'package:unittest/unittest.dart'; | |
10 import 'service_test_common.dart'; | |
11 import 'test_helper.dart'; | |
12 | |
13 const LINE_A = 24; | |
14 const LINE_B = 25; | |
15 const LINE_C = 29; | |
16 const LINE_D = 32; | |
17 const LINE_E = 38; | |
18 const LINE_F = 39; | |
19 const LINE_G = 40; | |
20 const LINE_H = 30; | |
21 const LINE_I = 34; | |
22 | |
23 foobar() async* { | |
24 yield 1; // LINE_A. | |
25 yield 2; // LINE_B. | |
26 } | |
27 | |
28 helper() async { | |
29 print('helper'); // LINE_C. | |
30 await for (var i in foobar()) { | |
31 // LINE_H. | |
32 debugger(); | |
33 print('loop'); // LINE_D. | |
34 } | |
35 } // LINE_I. | |
36 | |
37 testMain() { | |
38 debugger(); | |
39 print('mmmmm'); // LINE_E. | |
40 helper(); // LINE_F. | |
41 print('z'); // LINE_G. | |
42 } | |
43 | |
44 var tests = [ | |
45 hasStoppedAtBreakpoint, | |
46 stoppedAtLine(LINE_E), | |
47 stepOver, // print. | |
48 hasStoppedAtBreakpoint, | |
49 stoppedAtLine(LINE_F), | |
50 stepInto, | |
51 hasStoppedAtBreakpoint, | |
52 stoppedAtLine(LINE_C), | |
53 stepOver, // print. | |
54 hasStoppedAtBreakpoint, | |
55 stepInto, | |
56 hasStoppedAtBreakpoint, | |
57 stoppedAtLine(LINE_A), | |
58 stepOut, // step out of generator. | |
59 hasStoppedAtBreakpoint, | |
60 stoppedAtLine(LINE_H), // await for. | |
61 stepInto, | |
62 hasStoppedAtBreakpoint, // debugger(). | |
63 stepInto, | |
64 hasStoppedAtBreakpoint, | |
65 stoppedAtLine(LINE_D), // print. | |
66 stepInto, | |
67 hasStoppedAtBreakpoint, // await for. | |
68 stepInto, | |
69 hasStoppedAtBreakpoint, // back in generator. | |
70 stoppedAtLine(LINE_B), | |
71 stepOut, // step out of generator. | |
72 hasStoppedAtBreakpoint, | |
73 stoppedAtLine(LINE_H), // await for. | |
74 stepInto, | |
75 hasStoppedAtBreakpoint, // debugger(). | |
76 stepInto, | |
77 hasStoppedAtBreakpoint, | |
78 stoppedAtLine(LINE_D), // print. | |
79 stepInto, | |
80 hasStoppedAtBreakpoint, | |
81 stoppedAtLine(LINE_H), // await for. | |
82 stepInto, | |
83 hasStoppedAtBreakpoint, | |
84 stepOut, // step out of generator. | |
85 hasStoppedAtBreakpoint, | |
86 stoppedAtLine(LINE_I), // } tail of helper. | |
rmacnak
2017/03/29 01:07:54
The implicit return. Maybe use an explicit return
Cutch
2017/03/29 14:39:14
Done.
| |
87 ]; | |
88 | |
89 main(args) => | |
90 runIsolateTestsSynchronous(args, tests, testeeConcurrent: testMain); | |
OLD | NEW |