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 |
| 5 import 'test_helper.dart'; |
| 6 import 'service_test_common.dart'; |
| 7 |
| 8 const int LINE = 11; |
| 9 const String file = "step_through_function_2_test.dart"; |
| 10 |
| 11 code() { |
| 12 Bar bar = new Bar(); |
| 13 bar.barXYZ1(42); |
| 14 bar.barXYZ2(42); |
| 15 fooXYZ1(42); |
| 16 fooXYZ2(42); |
| 17 } |
| 18 |
| 19 int _xyz = -1; |
| 20 |
| 21 fooXYZ1(int i) { |
| 22 _xyz = i - 1; |
| 23 } |
| 24 |
| 25 fooXYZ2(int i) { |
| 26 _xyz = i; |
| 27 } |
| 28 |
| 29 class Bar { |
| 30 int _xyz = -1; |
| 31 |
| 32 barXYZ1(int i) { |
| 33 _xyz = i - 1; |
| 34 } |
| 35 |
| 36 barXYZ2(int i) { |
| 37 _xyz = i; |
| 38 } |
| 39 |
| 40 get barXYZ => _xyz + 1; |
| 41 } |
| 42 |
| 43 List<String> stops = []; |
| 44 List<String> expected = [ |
| 45 "$file:${LINE+0}:5", // after 'code' |
| 46 "$file:${LINE+1}:17", // on 'Bar' |
| 47 |
| 48 "$file:${LINE+2}:7", // on 'barXYZ1' |
| 49 "$file:${LINE+21}:15", // on 'i' |
| 50 "$file:${LINE+22}:14", // on '-' |
| 51 "$file:${LINE+22}:5", // on '_xyz' |
| 52 "$file:${LINE+23}:3", // on '}' |
| 53 |
| 54 "$file:${LINE+3}:7", // on 'barXYZ2' |
| 55 "$file:${LINE+25}:15", // on 'i' |
| 56 "$file:${LINE+26}:5", // on '_xyz' |
| 57 "$file:${LINE+27}:3", // on '}' |
| 58 |
| 59 "$file:${LINE+4}:3", // on 'fooXYZ1' |
| 60 "$file:${LINE+10}:13", // on 'i' |
| 61 "$file:${LINE+11}:12", // on '-' |
| 62 "$file:${LINE+12}:1", // on '}' |
| 63 |
| 64 "$file:${LINE+5}:3", // on 'fooXYZ2' |
| 65 "$file:${LINE+14}:13", // on 'i' |
| 66 "$file:${LINE+15}:3", // on '_xyz' |
| 67 "$file:${LINE+16}:1", // on '}' |
| 68 |
| 69 "$file:${LINE+6}:1" // on ending '}' |
| 70 ]; |
| 71 |
| 72 var tests = [ |
| 73 hasPausedAtStart, |
| 74 setBreakpointAtLine(LINE), |
| 75 runStepIntoThroughProgramRecordingStops(stops), |
| 76 checkRecordedStops(stops, expected, |
| 77 debugPrint: true, debugPrintFile: file, debugPrintLine: LINE) |
| 78 ]; |
| 79 |
| 80 main(args) { |
| 81 runIsolateTestsSynchronous(args, tests, |
| 82 testeeConcurrent: code, pause_on_start: true, pause_on_exit: true); |
| 83 } |
OLD | NEW |