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_setter_test.dart"; |
| 10 |
| 11 code() { |
| 12 Bar bar = new Bar(); |
| 13 bar.barXYZ = 42; |
| 14 fooXYZ = 42; |
| 15 } |
| 16 |
| 17 int _xyz = -1; |
| 18 |
| 19 set fooXYZ(int i) { |
| 20 _xyz = i - 1; |
| 21 } |
| 22 |
| 23 class Bar { |
| 24 int _xyz = -1; |
| 25 |
| 26 set barXYZ(int i) { |
| 27 _xyz = i - 1; |
| 28 } |
| 29 |
| 30 get barXYZ => _xyz + 1; |
| 31 } |
| 32 |
| 33 List<String> stops = []; |
| 34 List<String> expected = [ |
| 35 "$file:${LINE+0}:5", // after 'code' |
| 36 "$file:${LINE+1}:17", // on 'Bar' |
| 37 |
| 38 "$file:${LINE+2}:7", // on 'barXYZ' |
| 39 "$file:${LINE+15}:18", // on 'i' |
| 40 "$file:${LINE+16}:14", // on '-' |
| 41 "$file:${LINE+16}:5", // on '_xyz' |
| 42 "$file:${LINE+17}:3", // on '}' |
| 43 |
| 44 "$file:${LINE+3}:3", // on 'fooXYZ' |
| 45 "$file:${LINE+8}:16", // on 'i' |
| 46 "$file:${LINE+9}:12", // on '-' |
| 47 "$file:${LINE+10}:1", // on '}' |
| 48 |
| 49 "$file:${LINE+4}:1" // on ending '}' |
| 50 ]; |
| 51 |
| 52 var tests = [ |
| 53 hasPausedAtStart, |
| 54 setBreakpointAtLine(LINE), |
| 55 runStepIntoThroughProgramRecordingStops(stops), |
| 56 checkRecordedStops(stops, expected, |
| 57 debugPrint: true, debugPrintFile: file, debugPrintLine: LINE) |
| 58 ]; |
| 59 |
| 60 main(args) { |
| 61 runIsolateTestsSynchronous(args, tests, |
| 62 testeeConcurrent: code, pause_on_start: true, pause_on_exit: true); |
| 63 } |
OLD | NEW |