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

Unified Diff: test/codegen/expect/language/sync_generator3_test_test1_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/sync_generator3_test_test1_multi.js
diff --git a/test/codegen/expect/language/sync_generator3_test_test1_multi.js b/test/codegen/expect/language/sync_generator3_test_test1_multi.js
new file mode 100644
index 0000000000000000000000000000000000000000..1c12cb389dfd39f8be142590365eb038eb50a72d
--- /dev/null
+++ b/test/codegen/expect/language/sync_generator3_test_test1_multi.js
@@ -0,0 +1,61 @@
+dart_library.library('language/sync_generator3_test_test1_multi', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__sync_generator3_test_test1_multi(exports, dart_sdk, expect) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const sync_generator3_test_test1_multi = Object.create(null);
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let VoidTobool = () => (VoidTobool = dart.constFn(dart.definiteFunctionType(core.bool, [])))();
+ let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionType(core.bool, [dart.dynamic])))();
+ sync_generator3_test_test1_multi.f = function() {
+ return dart.syncStar(function*() {
+ try {
+ yield 1;
+ dart.throw("three");
+ } catch (e) {
+ yield 2;
+ yield e;
+ }
+ finally {
+ yield 4;
+ }
+ }, dart.dynamic);
+ };
+ dart.fn(sync_generator3_test_test1_multi.f, VoidTodynamic());
+ sync_generator3_test_test1_multi.test1 = function() {
+ let s = dart.toString(sync_generator3_test_test1_multi.f());
+ expect$.Expect.equals("(1, 2, three, 4)", s);
+ core.print(s);
+ };
+ dart.fn(sync_generator3_test_test1_multi.test1, VoidTodynamic());
+ sync_generator3_test_test1_multi.g = function() {
+ return dart.syncStar(function*() {
+ try {
+ yield "a";
+ dart.throw("pow!");
+ } finally {
+ yield "b";
+ }
+ }, dart.dynamic);
+ };
+ dart.fn(sync_generator3_test_test1_multi.g, VoidTodynamic());
+ sync_generator3_test_test1_multi.test2 = function() {
+ let i = core.Iterator._check(dart.dload(sync_generator3_test_test1_multi.g(), 'iterator'));
+ expect$.Expect.isTrue(i.moveNext());
+ expect$.Expect.equals("a", i.current);
+ expect$.Expect.isTrue(i.moveNext());
+ expect$.Expect.equals("b", i.current);
+ expect$.Expect.throws(dart.fn(() => i.moveNext(), VoidTobool()), dart.fn(error => dart.equals(error, "pow!"), dynamicTobool()));
+ };
+ dart.fn(sync_generator3_test_test1_multi.test2, VoidTodynamic());
+ sync_generator3_test_test1_multi.main = function() {
+ sync_generator3_test_test1_multi.test1();
+ };
+ dart.fn(sync_generator3_test_test1_multi.main, VoidTodynamic());
+ // Exports:
+ exports.sync_generator3_test_test1_multi = sync_generator3_test_test1_multi;
+});

Powered by Google App Engine
This is Rietveld 408576698