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

Unified Diff: test/codegen/expect/language/function_type_parameter_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/function_type_parameter_test.js
diff --git a/test/codegen/expect/language/function_type_parameter_test.js b/test/codegen/expect/language/function_type_parameter_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..b29f17f65bb126e5e81589beecc6cfdd6e285ad4
--- /dev/null
+++ b/test/codegen/expect/language/function_type_parameter_test.js
@@ -0,0 +1,49 @@
+dart_library.library('language/function_type_parameter_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__function_type_parameter_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 function_type_parameter_test = Object.create(null);
+ let intToString = () => (intToString = dart.constFn(dart.definiteFunctionType(core.String, [core.int])))();
+ let VoidToint = () => (VoidToint = dart.constFn(dart.definiteFunctionType(core.int, [])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ function_type_parameter_test.A = class A extends core.Object {
+ new(f) {
+ this.f = f;
+ }
+ nother(f) {
+ this.f = f;
+ }
+ static SetFunc(fmt) {
+ if (fmt === void 0) fmt = null;
+ function_type_parameter_test.A.func = fmt;
+ }
+ };
+ dart.defineNamedConstructor(function_type_parameter_test.A, 'nother');
+ dart.setSignature(function_type_parameter_test.A, {
+ constructors: () => ({
+ new: dart.definiteFunctionType(function_type_parameter_test.A, [dart.functionType(core.int, [])]),
+ nother: dart.definiteFunctionType(function_type_parameter_test.A, [dart.functionType(core.int, [])])
+ }),
+ statics: () => ({SetFunc: dart.definiteFunctionType(dart.dynamic, [], [dart.functionType(core.String, [core.int])])}),
+ names: ['SetFunc']
+ });
+ function_type_parameter_test.A.func = null;
+ function_type_parameter_test.main = function() {
+ expect$.Expect.equals(null, function_type_parameter_test.A.func);
+ function_type_parameter_test.A.SetFunc(dart.fn(i => dart.str`${i}`, intToString()));
+ expect$.Expect.equals(false, null == function_type_parameter_test.A.func);
+ expect$.Expect.equals("1234", dart.dsend(function_type_parameter_test.A, 'func', 1230 + 4));
+ function_type_parameter_test.A.SetFunc();
+ expect$.Expect.equals(null, function_type_parameter_test.A.func);
+ expect$.Expect.equals(42, dart.dsend(new function_type_parameter_test.A(dart.fn(() => 42, VoidToint())), 'f'));
+ expect$.Expect.equals(42, dart.dsend(new function_type_parameter_test.A.nother(dart.fn(() => 42, VoidToint())), 'f'));
+ };
+ dart.fn(function_type_parameter_test.main, VoidTodynamic());
+ // Exports:
+ exports.function_type_parameter_test = function_type_parameter_test;
+});

Powered by Google App Engine
This is Rietveld 408576698