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

Unified Diff: test/codegen/expect/language/async_star_regression_23116_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/async_star_regression_23116_test.js
diff --git a/test/codegen/expect/language/async_star_regression_23116_test.js b/test/codegen/expect/language/async_star_regression_23116_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..74c16665e44bec3d630eee8e034fe80e6c676a07
--- /dev/null
+++ b/test/codegen/expect/language/async_star_regression_23116_test.js
@@ -0,0 +1,46 @@
+dart_library.library('language/async_star_regression_23116_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect',
+ 'async_helper'
+], function load__async_star_regression_23116_test(exports, dart_sdk, expect, async_helper) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const async = dart_sdk.async;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const async_helper$ = async_helper.async_helper;
+ const async_star_regression_23116_test = Object.create(null);
+ let StreamOfint = () => (StreamOfint = dart.constFn(async.Stream$(core.int)))();
+ let CompleterAndFutureToStreamOfint = () => (CompleterAndFutureToStreamOfint = dart.constFn(dart.definiteFunctionType(StreamOfint(), [async.Completer, async.Future])))();
+ let intTovoid = () => (intTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.int])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let dynamicTovoid = () => (dynamicTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [dart.dynamic])))();
+ async_star_regression_23116_test.foo = function(completer, future) {
+ return dart.asyncStar(function*(stream, completer, future) {
+ completer.complete(100);
+ let x = core.int._check(yield future);
+ expect$.Expect.equals(42, x);
+ }, core.int, completer, future);
+ };
+ dart.fn(async_star_regression_23116_test.foo, CompleterAndFutureToStreamOfint());
+ async_star_regression_23116_test.test = function() {
+ return dart.async(function*() {
+ let completer1 = async.Completer.new();
+ let completer2 = async.Completer.new();
+ let s = async_star_regression_23116_test.foo(completer1, completer2.future).listen(dart.fn(v => null, intTovoid()));
+ yield completer1.future;
+ s.pause();
+ s.resume();
+ completer2.complete(42);
+ }, dart.dynamic);
+ };
+ dart.fn(async_star_regression_23116_test.test, VoidTodynamic());
+ async_star_regression_23116_test.main = function() {
+ async_helper$.asyncStart();
+ dart.dsend(async_star_regression_23116_test.test(), 'then', dart.fn(_ => async_helper$.asyncEnd(), dynamicTovoid()));
+ };
+ dart.fn(async_star_regression_23116_test.main, VoidTodynamic());
+ // Exports:
+ exports.async_star_regression_23116_test = async_star_regression_23116_test;
+});

Powered by Google App Engine
This is Rietveld 408576698