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

Unified Diff: test/codegen/expect/language/function_type3_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_type3_test.js
diff --git a/test/codegen/expect/language/function_type3_test.js b/test/codegen/expect/language/function_type3_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..2ad3b894ec2f69f39eb2997676e34b764369ec16
--- /dev/null
+++ b/test/codegen/expect/language/function_type3_test.js
@@ -0,0 +1,55 @@
+dart_library.library('language/function_type3_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__function_type3_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_type3_test = Object.create(null);
+ let A = () => (A = dart.constFn(function_type3_test.A$()))();
+ let B = () => (B = dart.constFn(function_type3_test.B$()))();
+ let AOfint = () => (AOfint = dart.constFn(function_type3_test.A$(core.int)))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ function_type3_test.A$ = dart.generic(T => {
+ let BOfT = () => (BOfT = dart.constFn(function_type3_test.B$(T)))();
+ class A extends core.Object {
+ new() {
+ }
+ foo() {
+ return new (BOfT())();
+ }
+ }
+ dart.addTypeTests(A);
+ dart.setSignature(A, {
+ constructors: () => ({new: dart.definiteFunctionType(function_type3_test.A$(T), [])}),
+ methods: () => ({foo: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ return A;
+ });
+ function_type3_test.A = A();
+ function_type3_test.B$ = dart.generic(T => {
+ class B extends core.Object {
+ bar() {
+ return null;
+ }
+ }
+ dart.addTypeTests(B);
+ dart.setSignature(B, {
+ methods: () => ({bar: dart.definiteFunctionType(T, [])})
+ });
+ return B;
+ });
+ function_type3_test.B = B();
+ function_type3_test.F = dart.typedef('F', () => dart.functionType(dart.dynamic, []));
+ function_type3_test.F2 = dart.typedef('F2', () => dart.functionType(dart.dynamic, [dart.dynamic]));
+ function_type3_test.main = function() {
+ let f = dart.dload(new (AOfint())().foo(), 'bar');
+ expect$.Expect.isTrue(function_type3_test.F.is(f));
+ expect$.Expect.isFalse(function_type3_test.F2.is(f));
+ };
+ dart.fn(function_type3_test.main, VoidTodynamic());
+ // Exports:
+ exports.function_type3_test = function_type3_test;
+});
« no previous file with comments | « test/codegen/expect/language/function_type2_test.js ('k') | test/codegen/expect/language/function_type_alias2_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698