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

Unified Diff: test/codegen/expect/language/cond_expr_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/cond_expr_test.js
diff --git a/test/codegen/expect/language/cond_expr_test.js b/test/codegen/expect/language/cond_expr_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..a04e9df8a13764516a459e518fde622a13df72e1
--- /dev/null
+++ b/test/codegen/expect/language/cond_expr_test.js
@@ -0,0 +1,36 @@
+dart_library.library('language/cond_expr_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__cond_expr_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 cond_expr_test = Object.create(null);
+ let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ cond_expr_test.e1 = null;
+ cond_expr_test.e2 = null;
+ cond_expr_test.f = function(a) {
+ return dart.test(dart.dsend(a, '<', 0)) ? cond_expr_test.e1 = -1 : cond_expr_test.e2 = 1;
+ };
+ dart.fn(cond_expr_test.f, dynamicTodynamic());
+ cond_expr_test.main = function() {
+ cond_expr_test.e1 = 0;
+ cond_expr_test.e2 = 0;
+ let r = cond_expr_test.f(-100);
+ expect$.Expect.equals(-1, r);
+ expect$.Expect.equals(-1, cond_expr_test.e1);
+ expect$.Expect.equals(0, cond_expr_test.e2);
+ cond_expr_test.e1 = 0;
+ cond_expr_test.e2 = 0;
+ r = cond_expr_test.f(100);
+ expect$.Expect.equals(1, r);
+ expect$.Expect.equals(0, cond_expr_test.e1);
+ expect$.Expect.equals(1, cond_expr_test.e2);
+ };
+ dart.fn(cond_expr_test.main, VoidTodynamic());
+ // Exports:
+ exports.cond_expr_test = cond_expr_test;
+});

Powered by Google App Engine
This is Rietveld 408576698