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

Unified Diff: test/codegen/expect/language/async_switch_test_withDefault_multi.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/async_switch_test_withDefault_multi.js
diff --git a/test/codegen/expect/language/async_switch_test_withDefault_multi.js b/test/codegen/expect/language/async_switch_test_withDefault_multi.js
new file mode 100644
index 0000000000000000000000000000000000000000..fc993e0d4b8fdf3c83191bfa1e92d526ba44150d
--- /dev/null
+++ b/test/codegen/expect/language/async_switch_test_withDefault_multi.js
@@ -0,0 +1,141 @@
+dart_library.library('language/async_switch_test_withDefault_multi', null, /* Imports */[
+ 'dart_sdk',
+ 'expect',
+ 'async_helper'
+], function load__async_switch_test_withDefault_multi(exports, dart_sdk, expect, async_helper) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const async_helper$ = async_helper.async_helper;
+ const async_switch_test_withDefault_multi = Object.create(null);
+ let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let dynamicTovoid = () => (dynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [dart.dynamic])))();
+ let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [])))();
+ async_switch_test_withDefault_multi.foo1 = function(a) {
+ return dart.async(function*(a) {
+ let k = 0;
+ switch (a) {
+ case 1:
+ {
+ yield 3;
+ k = dart.notNull(k) + 1;
+ break;
+ }
+ case 2:
+ {
+ k = dart.notNull(k) + dart.notNull(core.int._check(a));
+ return dart.notNull(k) + 2;
+ }
+ default:
+ {
+ k = 2;
+ }
+ }
+ return k;
+ }, dart.dynamic, a);
+ };
+ dart.fn(async_switch_test_withDefault_multi.foo1, dynamicTodynamic());
+ async_switch_test_withDefault_multi.foo2 = function(a) {
+ return dart.async(function*(a) {
+ let k = 0;
+ switch (yield a) {
+ case 1:
+ {
+ yield 3;
+ k = dart.notNull(k) + 1;
+ break;
+ }
+ case 2:
+ {
+ k = dart.notNull(k) + dart.notNull(core.int._check(yield a));
+ return dart.notNull(k) + 2;
+ }
+ default:
+ {
+ k = 2;
+ }
+ }
+ return k;
+ }, dart.dynamic, a);
+ };
+ dart.fn(async_switch_test_withDefault_multi.foo2, dynamicTodynamic());
+ async_switch_test_withDefault_multi.foo3 = function(a) {
+ return dart.async(function*(a) {
+ let k = 0;
+ switch (a) {
+ case 1:
+ {
+ k = dart.notNull(k) + 1;
+ break;
+ }
+ case 2:
+ {
+ k = dart.notNull(k) + dart.notNull(core.int._check(a));
+ return dart.notNull(k) + 2;
+ }
+ default:
+ {
+ k = 2;
+ }
+ }
+ return k;
+ }, dart.dynamic, a);
+ };
+ dart.fn(async_switch_test_withDefault_multi.foo3, dynamicTodynamic());
+ async_switch_test_withDefault_multi.foo4 = function(value) {
+ return dart.async(function*(value) {
+ let k = 0;
+ switch (yield value) {
+ case 1:
+ {
+ k = k + 1;
+ break;
+ }
+ case 2:
+ {
+ k = k + 2;
+ return 2 + k;
+ }
+ default:
+ {
+ k = 2;
+ }
+ }
+ return k;
+ }, dart.dynamic, value);
+ };
+ dart.fn(async_switch_test_withDefault_multi.foo4, dynamicTodynamic());
+ async_switch_test_withDefault_multi.futureOf = function(a) {
+ return dart.async(function*(a) {
+ return yield a;
+ }, dart.dynamic, a);
+ };
+ dart.fn(async_switch_test_withDefault_multi.futureOf, dynamicTodynamic());
+ async_switch_test_withDefault_multi.test = function() {
+ return dart.async(function*() {
+ expect$.Expect.equals(1, yield async_switch_test_withDefault_multi.foo1(1));
+ expect$.Expect.equals(4, yield async_switch_test_withDefault_multi.foo1(2));
+ expect$.Expect.equals(2, yield async_switch_test_withDefault_multi.foo1(3));
+ expect$.Expect.equals(1, yield async_switch_test_withDefault_multi.foo2(async_switch_test_withDefault_multi.futureOf(1)));
+ expect$.Expect.equals(4, yield async_switch_test_withDefault_multi.foo2(async_switch_test_withDefault_multi.futureOf(2)));
+ expect$.Expect.equals(2, yield async_switch_test_withDefault_multi.foo2(async_switch_test_withDefault_multi.futureOf(3)));
+ expect$.Expect.equals(1, yield async_switch_test_withDefault_multi.foo3(1));
+ expect$.Expect.equals(4, yield async_switch_test_withDefault_multi.foo3(2));
+ expect$.Expect.equals(2, yield async_switch_test_withDefault_multi.foo3(3));
+ expect$.Expect.equals(1, yield async_switch_test_withDefault_multi.foo4(async_switch_test_withDefault_multi.futureOf(1)));
+ expect$.Expect.equals(4, yield async_switch_test_withDefault_multi.foo4(async_switch_test_withDefault_multi.futureOf(2)));
+ expect$.Expect.equals(2, yield async_switch_test_withDefault_multi.foo4(async_switch_test_withDefault_multi.futureOf(3)));
+ }, dart.dynamic);
+ };
+ dart.fn(async_switch_test_withDefault_multi.test, VoidTodynamic());
+ async_switch_test_withDefault_multi.main = function() {
+ async_helper$.asyncStart();
+ dart.dsend(async_switch_test_withDefault_multi.test(), 'then', dart.fn(_ => async_helper$.asyncEnd(), dynamicTovoid()));
+ };
+ dart.fn(async_switch_test_withDefault_multi.main, VoidTovoid());
+ // Exports:
+ exports.async_switch_test_withDefault_multi = async_switch_test_withDefault_multi;
+});
« no previous file with comments | « test/codegen/expect/language/async_switch_test_none_multi.js ('k') | test/codegen/expect/language/async_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698