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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 dart_library.library('language/infinite_switch_label_test', null, /* Imports */[
2 'dart_sdk',
3 'expect'
4 ], function load__infinite_switch_label_test(exports, dart_sdk, expect) {
5 'use strict';
6 const core = dart_sdk.core;
7 const _interceptors = dart_sdk._interceptors;
8 const dart = dart_sdk.dart;
9 const dartx = dart_sdk.dartx;
10 const expect$ = expect.expect;
11 const infinite_switch_label_test = Object.create(null);
12 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c ore.int)))();
13 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da rt.void, [])))();
14 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT ype(core.bool, [dart.dynamic])))();
15 let intTovoid = () => (intTovoid = dart.constFn(dart.definiteFunctionType(dart .void, [core.int])))();
16 infinite_switch_label_test.main = function() {
17 expect$.Expect.throws(dart.fn(() => infinite_switch_label_test.doSwitch(0), VoidTovoid()), dart.fn(list => {
18 expect$.Expect.listEquals(JSArrayOfint().of([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]), core.List._check(list));
19 return true;
20 }, dynamicTobool()));
21 expect$.Expect.throws(dart.fn(() => infinite_switch_label_test.doSwitch(2), VoidTovoid()), dart.fn(list => {
22 expect$.Expect.listEquals(JSArrayOfint().of([2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]), core.List._check(list));
23 return true;
24 }, dynamicTobool()));
25 };
26 dart.fn(infinite_switch_label_test.main, VoidTovoid());
27 infinite_switch_label_test.doSwitch = function(target) {
28 let list = [];
29 switch (target) {
30 case 0:
31 {
32 // Unimplemented case labels: [l0:]
33 if (dart.notNull(list[dartx.length]) > 10) dart.throw(list);
34 list[dartx.add](0);
35 continue l1;
36 }
37 case 1:
38 {
39 // Unimplemented case labels: [l1:]
40 if (dart.notNull(list[dartx.length]) > 10) dart.throw(list);
41 list[dartx.add](1);
42 continue l0;
43 }
44 default:
45 {
46 list[dartx.add](2);
47 continue l1;
48 }
49 }
50 };
51 dart.fn(infinite_switch_label_test.doSwitch, intTovoid());
52 // Exports:
53 exports.infinite_switch_label_test = infinite_switch_label_test;
54 });
OLDNEW
« 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