OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 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 | 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 import 'test_helper.dart'; | 5 import 'test_helper.dart'; |
6 import 'service_test_common.dart'; | 6 import 'service_test_common.dart'; |
7 | 7 |
8 const int LINE_A = 11; | 8 const int LINE_A = 11; |
9 const String file = "next_through_function_expression_test.dart"; | 9 const String file = "next_through_function_expression_test.dart"; |
10 | 10 |
11 codeXYZ(int i) { | 11 codeXYZ(int i) { |
12 innerOne() { | 12 innerOne() { |
13 return i * i; | 13 return i * i; |
14 } | 14 } |
15 | |
16 return innerOne(); | 15 return innerOne(); |
17 } | 16 } |
18 | 17 |
19 code() { | 18 code() { |
20 codeXYZ(42); | 19 codeXYZ(42); |
21 } | 20 } |
22 | 21 |
23 List<String> stops = []; | 22 List<String> stops = []; |
24 List<String> expected = [ | 23 List<String> expected = [ |
25 "$file:${LINE_A+0}:13", // on 'i' in 'codeXYZ(int i)' | 24 "$file:${LINE_A+0}:13", // on 'i' in 'codeXYZ(int i)' |
26 "$file:${LINE_A+1}:3", // on 'innerOne' | 25 "$file:${LINE_A+1}:3", // on 'innerOne' |
27 "$file:${LINE_A+5}:18", // on '(', i.e. after 'innerOne' call | 26 "$file:${LINE_A+4}:18", // on '(', i.e. after 'innerOne' call |
28 "$file:${LINE_A+5}:3" // on 'return' | 27 "$file:${LINE_A+4}:3" // on 'return' |
29 ]; | 28 ]; |
30 | 29 |
31 var tests = [ | 30 var tests = [ |
32 hasPausedAtStart, | 31 hasPausedAtStart, |
33 setBreakpointAtLine(LINE_A), | 32 setBreakpointAtLine(LINE_A), |
34 runStepThroughProgramRecordingStops(stops), | 33 runStepThroughProgramRecordingStops(stops), |
35 checkRecordedStops(stops, expected) | 34 checkRecordedStops(stops, expected) |
36 ]; | 35 ]; |
37 | 36 |
38 main(args) { | 37 main(args) { |
39 runIsolateTestsSynchronous(args, tests, | 38 runIsolateTestsSynchronous(args, tests, |
40 testeeConcurrent: code, pause_on_start: true, pause_on_exit: true); | 39 testeeConcurrent: code, pause_on_start: true, pause_on_exit: true); |
41 } | 40 } |
OLD | NEW |