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

Unified Diff: test/codegen/expect/language/infinite_switch_label_test.js

Issue 2128353002: Check in codegen test expectations. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 5 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
Index: test/codegen/expect/language/infinite_switch_label_test.js
diff --git a/test/codegen/expect/language/infinite_switch_label_test.js b/test/codegen/expect/language/infinite_switch_label_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..380a927299803422794b49fc98c6ea21973b2a93
--- /dev/null
+++ b/test/codegen/expect/language/infinite_switch_label_test.js
@@ -0,0 +1,54 @@
+dart_library.library('language/infinite_switch_label_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__infinite_switch_label_test(exports, dart_sdk, expect) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const _interceptors = dart_sdk._interceptors;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const infinite_switch_label_test = Object.create(null);
+ let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(core.int)))();
+ let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [])))();
+ let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionType(core.bool, [dart.dynamic])))();
+ let intTovoid = () => (intTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int])))();
+ infinite_switch_label_test.main = function() {
+ expect$.Expect.throws(dart.fn(() => infinite_switch_label_test.doSwitch(0), VoidTovoid()), dart.fn(list => {
+ expect$.Expect.listEquals(JSArrayOfint().of([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]), core.List._check(list));
+ return true;
+ }, dynamicTobool()));
+ expect$.Expect.throws(dart.fn(() => infinite_switch_label_test.doSwitch(2), VoidTovoid()), dart.fn(list => {
+ expect$.Expect.listEquals(JSArrayOfint().of([2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]), core.List._check(list));
+ return true;
+ }, dynamicTobool()));
+ };
+ dart.fn(infinite_switch_label_test.main, VoidTovoid());
+ infinite_switch_label_test.doSwitch = function(target) {
+ let list = [];
+ switch (target) {
+ case 0:
+ {
+ // Unimplemented case labels: [l0:]
+ if (dart.notNull(list[dartx.length]) > 10) dart.throw(list);
+ list[dartx.add](0);
+ continue l1;
+ }
+ case 1:
+ {
+ // Unimplemented case labels: [l1:]
+ if (dart.notNull(list[dartx.length]) > 10) dart.throw(list);
+ list[dartx.add](1);
+ continue l0;
+ }
+ default:
+ {
+ list[dartx.add](2);
+ continue l1;
+ }
+ }
+ };
+ dart.fn(infinite_switch_label_test.doSwitch, intTovoid());
+ // Exports:
+ exports.infinite_switch_label_test = infinite_switch_label_test;
+});
« no previous file with comments | « test/codegen/expect/language/inferrer_this_access_test.js ('k') | test/codegen/expect/language/infinity_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698