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

Unified Diff: test/codegen/expect/language/compile_time_constant_f_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/compile_time_constant_f_test.js
diff --git a/test/codegen/expect/language/compile_time_constant_f_test.js b/test/codegen/expect/language/compile_time_constant_f_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..a7c0bb3f1a163c9e375ebd6344dabcce6cbaa4be
--- /dev/null
+++ b/test/codegen/expect/language/compile_time_constant_f_test.js
@@ -0,0 +1,49 @@
+dart_library.library('language/compile_time_constant_f_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__compile_time_constant_f_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 compile_time_constant_f_test = Object.create(null);
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ compile_time_constant_f_test.A = class A extends core.Object {
+ new(x) {
+ this.x = x;
+ }
+ named(x) {
+ if (x === void 0) x = null;
+ this.x = x;
+ }
+ named2(x) {
+ if (x === void 0) x = 2;
+ this.x = x;
+ }
+ };
+ dart.defineNamedConstructor(compile_time_constant_f_test.A, 'named');
+ dart.defineNamedConstructor(compile_time_constant_f_test.A, 'named2');
+ dart.setSignature(compile_time_constant_f_test.A, {
+ constructors: () => ({
+ new: dart.definiteFunctionType(compile_time_constant_f_test.A, [dart.dynamic]),
+ named: dart.definiteFunctionType(compile_time_constant_f_test.A, [], [dart.dynamic]),
+ named2: dart.definiteFunctionType(compile_time_constant_f_test.A, [], [dart.dynamic])
+ })
+ });
+ compile_time_constant_f_test.a1 = dart.const(new compile_time_constant_f_test.A(0));
+ compile_time_constant_f_test.a2 = dart.const(new compile_time_constant_f_test.A.named());
+ compile_time_constant_f_test.a3 = dart.const(new compile_time_constant_f_test.A.named(1));
+ compile_time_constant_f_test.a4 = dart.const(new compile_time_constant_f_test.A.named2());
+ compile_time_constant_f_test.a5 = dart.const(new compile_time_constant_f_test.A.named2(3));
+ compile_time_constant_f_test.main = function() {
+ expect$.Expect.equals(0, compile_time_constant_f_test.a1.x);
+ expect$.Expect.equals(null, compile_time_constant_f_test.a2.x);
+ expect$.Expect.equals(1, compile_time_constant_f_test.a3.x);
+ expect$.Expect.equals(2, compile_time_constant_f_test.a4.x);
+ expect$.Expect.equals(3, compile_time_constant_f_test.a5.x);
+ };
+ dart.fn(compile_time_constant_f_test.main, VoidTodynamic());
+ // Exports:
+ exports.compile_time_constant_f_test = compile_time_constant_f_test;
+});

Powered by Google App Engine
This is Rietveld 408576698