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

Unified Diff: test/codegen/expect/language/for2_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/for2_test.js
diff --git a/test/codegen/expect/language/for2_test.js b/test/codegen/expect/language/for2_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..28998f9c78035b9234d25dea31797d6e17903966
--- /dev/null
+++ b/test/codegen/expect/language/for2_test.js
@@ -0,0 +1,63 @@
+dart_library.library('language/for2_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__for2_test(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 for2_test = Object.create(null);
+ let VoidToString = () => (VoidToString = dart.constFn(dart.definiteFunctionType(core.String, [])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ for2_test.f = null;
+ for2_test.main = function() {
+ for (let i = 0; i < 10; i++) {
+ if (i == 7) {
+ for2_test.f = dart.fn(() => dart.str`i = ${i}`, VoidToString());
+ }
+ }
+ expect$.Expect.equals("i = 7", dart.dcall(for2_test.f));
+ let k = null;
+ for (k = 0; dart.notNull(k) < 10; k = dart.notNull(k) + 1) {
+ if (k == 7) {
+ for2_test.f = dart.fn(() => dart.str`k = ${k}`, VoidToString());
+ }
+ }
+ expect$.Expect.equals("k = 10", dart.dcall(for2_test.f));
+ for (let n = 0; n < 10; n++) {
+ let l = n;
+ if (l == 7) {
+ for2_test.f = dart.fn(() => dart.str`l = ${l}, n = ${n}`, VoidToString());
+ }
+ l++;
+ }
+ expect$.Expect.equals("l = 8, n = 7", dart.dcall(for2_test.f));
+ for (let i = 0; i < 10;) {
+ if (i == 7) {
+ for2_test.f = dart.fn(() => dart.str`i = ${i}`, VoidToString());
+ }
+ i++;
+ }
+ expect$.Expect.equals("i = 8", dart.dcall(for2_test.f));
+ for (let i = 0; i < 10; i++) {
+ if (i == 7) {
+ for2_test.f = dart.fn(() => dart.str`i = ${i}`, VoidToString());
+ }
+ continue;
+ i++;
+ }
+ expect$.Expect.equals("i = 7", dart.dcall(for2_test.f));
+ for (let k = 0; k < 5; k++) {
+ for (let i = 0; i < 10; i++) {
+ if (k == 3 && i == 7) {
+ for2_test.f = dart.fn(() => dart.str`k = ${k}, i = ${i}`, VoidToString());
+ }
+ }
+ }
+ expect$.Expect.equals("k = 3, i = 7", dart.dcall(for2_test.f));
+ };
+ dart.fn(for2_test.main, VoidTodynamic());
+ // Exports:
+ exports.for2_test = for2_test;
+});
« no previous file with comments | « test/codegen/expect/language/flatten_test_none_multi.js ('k') | test/codegen/expect/language/for_in2_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698