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

Unified Diff: test/codegen/expect/language/await_regression_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
« no previous file with comments | « test/codegen/expect/language/await_postfix_expr_test.js ('k') | test/codegen/expect/language/await_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/language/await_regression_test.js
diff --git a/test/codegen/expect/language/await_regression_test.js b/test/codegen/expect/language/await_regression_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..b6d6adeb7cd86a0bfd64de331f4aa70203191a61
--- /dev/null
+++ b/test/codegen/expect/language/await_regression_test.js
@@ -0,0 +1,57 @@
+dart_library.library('language/await_regression_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__await_regression_test(exports, dart_sdk, expect) {
+ '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 await_regression_test = Object.create(null);
+ let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let __Todynamic = () => (__Todynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [], {a: dart.dynamic, b: dart.dynamic})))();
+ await_regression_test.later = function(vodka) {
+ return async.Future.value(vodka);
+ };
+ dart.fn(await_regression_test.later, dynamicTodynamic());
+ await_regression_test.manana = function(tequila) {
+ return dart.async(function*(tequila) {
+ return tequila;
+ }, dart.dynamic, tequila);
+ };
+ dart.fn(await_regression_test.manana, dynamicTodynamic());
+ await_regression_test.testNestedFunctions = function() {
+ return dart.async(function*() {
+ let a = (yield dart.dsend(await_regression_test.later('Asterix'), 'then', dart.fn(tonic => await_regression_test.later(tonic), dynamicTodynamic())));
+ let o = (yield dart.dsend(await_regression_test.manana('Obelix'), 'then', await_regression_test.manana));
+ expect$.Expect.equals(dart.str`${a} and ${o}`, "Asterix and Obelix");
+ }, dart.dynamic);
+ };
+ dart.fn(await_regression_test.testNestedFunctions, VoidTodynamic());
+ await_regression_test.addLater = function(opts) {
+ let a = opts && 'a' in opts ? opts.a : null;
+ let b = opts && 'b' in opts ? opts.b : null;
+ return async.Future.value(dart.dsend(a, '+', b));
+ };
+ dart.fn(await_regression_test.addLater, __Todynamic());
+ await_regression_test.testNamedArguments = function() {
+ return dart.async(function*() {
+ let sum = (yield await_regression_test.addLater({a: 5, b: 10}));
+ expect$.Expect.equals(sum, 15);
+ sum = (yield await_regression_test.addLater({b: 11, a: -11}));
+ expect$.Expect.equals(sum, 0);
+ }, dart.dynamic);
+ };
+ dart.fn(await_regression_test.testNamedArguments, VoidTodynamic());
+ await_regression_test.main = function() {
+ return dart.async(function*() {
+ await_regression_test.testNestedFunctions();
+ await_regression_test.testNamedArguments();
+ }, dart.dynamic);
+ };
+ dart.fn(await_regression_test.main, VoidTodynamic());
+ // Exports:
+ exports.await_regression_test = await_regression_test;
+});
« no previous file with comments | « test/codegen/expect/language/await_postfix_expr_test.js ('k') | test/codegen/expect/language/await_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698