Chromium Code Reviews| Index: runtime/observatory/tests/service/next_through_create_list_and_map_test.dart |
| diff --git a/runtime/observatory/tests/service/next_through_create_list_and_map_test.dart b/runtime/observatory/tests/service/next_through_create_list_and_map_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..31ace389bfafd243cdb3e552408eb1e89e52488c |
| --- /dev/null |
| +++ b/runtime/observatory/tests/service/next_through_create_list_and_map_test.dart |
| @@ -0,0 +1,87 @@ |
| +import 'test_helper.dart'; |
|
Kevin Millikin (Google)
2017/02/08 15:37:51
License header.
jensj
2017/02/13 14:04:16
Done.
|
| +import 'service_test_common.dart'; |
| + |
| +const int LINE_A = 8; |
| +const String file = "next_through_create_list_and_map_test.dart"; |
| + |
| +code() { |
| + List<int> myList = [ |
| + 1234567890, |
| + 1234567891, |
| + 1234567892, |
| + 1234567893, |
| + 1234567894 |
| + ]; |
| + List<int> myConstList = const [ |
| + 1234567890, |
| + 1234567891, |
| + 1234567892, |
| + 1234567893, |
| + 1234567894 |
| + ]; |
| + Map<int, int> myMap = { |
| + 1: 42, |
| + 2: 43, |
| + 33242344: 432432432, |
| + 443243232: 543242454 |
| + }; |
| + Map<int, int> myConstMap = const { |
| + 1: 42, |
| + 2: 43, |
| + 33242344: 432432432, |
| + 443243232: 543242454 |
| + }; |
| + print(myList); |
| + print(myConstList); |
| + int lookup = myMap[1]; |
| + print(lookup); |
| + print(myMap); |
| + print(myConstMap); |
| + print(myMap[2]); |
| +} |
| + |
| +List<String> stops = []; |
| +List<String> expected = [ |
| + // Initialize list |
| + "$file:${LINE_A+0}:22", |
| + |
| + // Initialize const list |
| + "$file:${LINE_A+7}:25", |
| + |
| + // Initialize map |
| + "$file:${LINE_A+14}:25", |
| + |
| + // Initialize const map |
| + "$file:${LINE_A+20}:28", |
| + |
| + // Prints |
| + "$file:${LINE_A+26}:3", |
| + "$file:${LINE_A+27}:3", |
| + |
| + // Lookup |
| + "$file:${LINE_A+28}:21", |
| + |
| + // Prints |
| + "$file:${LINE_A+29}:3", |
| + "$file:${LINE_A+30}:3", |
| + "$file:${LINE_A+31}:3", |
| + |
| + // Lookup + print |
| + "$file:${LINE_A+32}:14", |
| + "$file:${LINE_A+32}:3", |
| + |
| + // End |
| + "$file:${LINE_A+33}:1" |
| +]; |
| + |
| +var tests = [ |
| + hasPausedAtStart, |
| + setBreakpointAtLine(LINE_A), |
| + runStepThroughProgramRecordingStops(stops), |
| + checkRecordedStops(stops, expected) |
| +]; |
| + |
| +main(args) { |
| + runIsolateTestsSynchronous(args, tests, |
| + testeeConcurrent: code, pause_on_start: true, pause_on_exit: true); |
| +} |