Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Unified Diff: runtime/observatory/tests/service/step_through_switch_with_continue_test.dart

Issue 3004693002: [kernel] Add offset to SwitchContinueStatement; add debugging test (Closed)
Patch Set: ... Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/kernel/lib/binary/ast_to_binary.dart ('k') | runtime/vm/kernel_binary_flowgraph.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/service/step_through_switch_with_continue_test.dart
diff --git a/runtime/observatory/tests/service/step_through_switch_with_continue_test.dart b/runtime/observatory/tests/service/step_through_switch_with_continue_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..0c7c63ef0a99829f84c438171dc62307c538a523
--- /dev/null
+++ b/runtime/observatory/tests/service/step_through_switch_with_continue_test.dart
@@ -0,0 +1,57 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'test_helper.dart';
+import 'service_test_common.dart';
+
+const int LINE = 11;
+const String file = "step_through_switch_with_continue_test.dart";
+
+code() {
+ switch (switchOnMe.length) {
+ case 0:
+ print("(got 0!");
+ continue label;
+ label:
+ case 1:
+ print("Got 0 or 1!");
+ break;
+ case 2:
+ print("Got 2!");
+ break;
+ default:
+ print("Got lost!");
+ }
+}
+
+List<String> switchOnMe = [];
+List<String> stops = [];
+List<String> expected = [
+ "$file:${LINE+0}:5", // after 'code'
+
+ "$file:${LINE+1}:11", // on switchOnMe
+ "$file:${LINE+1}:22", // on length
+
+ "$file:${LINE+2}:10", // on 0
+ "$file:${LINE+3}:7", // on print
+ "$file:${LINE+4}:7", // on continue
+
+ "$file:${LINE+7}:7", // on print
+ "$file:${LINE+8}:7", // on break
+
+ "$file:${LINE+15}:1" // on ending '}'
+];
+
+var tests = [
+ hasPausedAtStart,
+ setBreakpointAtLine(LINE),
+ runStepIntoThroughProgramRecordingStops(stops),
+ checkRecordedStops(stops, expected,
+ debugPrint: true, debugPrintFile: file, debugPrintLine: LINE)
+];
+
+main(args) {
+ runIsolateTestsSynchronous(args, tests,
+ testeeConcurrent: code, pause_on_start: true, pause_on_exit: true);
+}
« no previous file with comments | « pkg/kernel/lib/binary/ast_to_binary.dart ('k') | runtime/vm/kernel_binary_flowgraph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698