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 = 33; |
| 9 const String file = "step_through_property_set_test.dart"; |
| 10 |
| 11 code() { |
| 12 Bar bar = new Bar(); |
| 13 bar.doStuff(); |
| 14 } |
| 15 |
| 16 class Foo { |
| 17 final List<String> data1; |
| 18 |
| 19 Foo() : data1 = ["a", "b", "c"]; |
| 20 |
| 21 void doStuff() { |
| 22 data1[1] = 'x'; |
| 23 print(data1[1]); |
| 24 } |
| 25 } |
| 26 |
| 27 class Bar extends Foo { |
| 28 final List<String> data2; |
| 29 |
| 30 Bar() : data2 = ["d", "e", "f"]; |
| 31 |
| 32 void doStuff() { |
| 33 data2[1] = '1'; |
| 34 print(data2[1]); |
| 35 |
| 36 data1[1] = '2'; |
| 37 print(data1[1]); |
| 38 |
| 39 super.data1[1] = '42'; |
| 40 print(super.data1[1]); |
| 41 } |
| 42 } |
| 43 |
| 44 List<String> stops = []; |
| 45 List<String> expected = [ |
| 46 "$file:${LINE+0}:5", // on 'data2' |
| 47 "$file:${LINE+0}:10", // on '[' |
| 48 "$file:${LINE+1}:11", // on 'data2' |
| 49 "$file:${LINE+1}:16", // on '[' |
| 50 "$file:${LINE+1}:5", // on 'print' |
| 51 |
| 52 "$file:${LINE+3}:5", // on 'data1' |
| 53 "$file:${LINE+3}:10", // on '[' |
| 54 "$file:${LINE+4}:11", // on 'data1' |
| 55 "$file:${LINE+4}:16", // on '[' |
| 56 "$file:${LINE+4}:5", // on 'print' |
| 57 |
| 58 "$file:${LINE+6}:11", // on 'data1' |
| 59 "$file:${LINE+6}:16", // on '[' |
| 60 "$file:${LINE+7}:17", // on 'data1' |
| 61 "$file:${LINE+7}:22", // on '[' |
| 62 "$file:${LINE+7}:5", // on 'print' |
| 63 |
| 64 "$file:${LINE+8}:3" // on ending '}' |
| 65 ]; |
| 66 |
| 67 var tests = [ |
| 68 hasPausedAtStart, |
| 69 setBreakpointAtLine(LINE), |
| 70 runStepIntoThroughProgramRecordingStops(stops), |
| 71 checkRecordedStops(stops, expected, |
| 72 debugPrint: true, debugPrintFile: file, debugPrintLine: LINE) |
| 73 ]; |
| 74 |
| 75 main(args) { |
| 76 runIsolateTestsSynchronous(args, tests, |
| 77 testeeConcurrent: code, pause_on_start: true, pause_on_exit: true); |
| 78 } |
OLD | NEW |