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

Unified Diff: test/codegen/expect/language/rewrite_if_return_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/rewrite_if_return_test.js
diff --git a/test/codegen/expect/language/rewrite_if_return_test.js b/test/codegen/expect/language/rewrite_if_return_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..8bd8220d2570d05545ea2de86c1104cb848fd953
--- /dev/null
+++ b/test/codegen/expect/language/rewrite_if_return_test.js
@@ -0,0 +1,56 @@
+dart_library.library('language/rewrite_if_return_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__rewrite_if_return_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 rewrite_if_return_test = Object.create(null);
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
+ let dynamicAnddynamicTodynamic = () => (dynamicAnddynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic])))();
+ rewrite_if_return_test.global = 0;
+ rewrite_if_return_test.bar = function() {
+ rewrite_if_return_test.global = 1;
+ };
+ dart.fn(rewrite_if_return_test.bar, VoidTodynamic());
+ rewrite_if_return_test.baz = function() {
+ rewrite_if_return_test.global = 2;
+ };
+ dart.fn(rewrite_if_return_test.baz, VoidTodynamic());
+ rewrite_if_return_test.return_const = function(b) {
+ if (dart.test(b)) {
+ rewrite_if_return_test.bar();
+ return 1;
+ } else {
+ rewrite_if_return_test.baz();
+ return 1;
+ }
+ };
+ dart.fn(rewrite_if_return_test.return_const, dynamicTodynamic());
+ rewrite_if_return_test.return_var = function(b, x) {
+ if (dart.test(b)) {
+ rewrite_if_return_test.bar();
+ return x;
+ } else {
+ rewrite_if_return_test.baz();
+ return x;
+ }
+ };
+ dart.fn(rewrite_if_return_test.return_var, dynamicAnddynamicTodynamic());
+ rewrite_if_return_test.main = function() {
+ rewrite_if_return_test.return_const(true);
+ expect$.Expect.equals(1, rewrite_if_return_test.global);
+ rewrite_if_return_test.return_const(false);
+ expect$.Expect.equals(2, rewrite_if_return_test.global);
+ expect$.Expect.equals(4, rewrite_if_return_test.return_var(true, 4));
+ expect$.Expect.equals(1, rewrite_if_return_test.global);
+ expect$.Expect.equals(5, rewrite_if_return_test.return_var(false, 5));
+ expect$.Expect.equals(2, rewrite_if_return_test.global);
+ };
+ dart.fn(rewrite_if_return_test.main, VoidTodynamic());
+ // Exports:
+ exports.rewrite_if_return_test = rewrite_if_return_test;
+});
« no previous file with comments | « test/codegen/expect/language/rewrite_if_empty_then_test.js ('k') | test/codegen/expect/language/rewrite_if_swap_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698