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

Unified Diff: test/codegen/expect/language/list_is_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/list_is_test.js
diff --git a/test/codegen/expect/language/list_is_test.js b/test/codegen/expect/language/list_is_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..2e99aad51963a2d3a2ab0001f1e0042c724025e8
--- /dev/null
+++ b/test/codegen/expect/language/list_is_test.js
@@ -0,0 +1,47 @@
+dart_library.library('language/list_is_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__list_is_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 list_is_test = Object.create(null);
+ let A = () => (A = dart.constFn(list_is_test.A$()))();
+ let ListOfint = () => (ListOfint = dart.constFn(core.List$(core.int)))();
+ let AOfdouble = () => (AOfdouble = dart.constFn(list_is_test.A$(core.double)))();
+ let ListOfdouble = () => (ListOfdouble = dart.constFn(core.List$(core.double)))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let dynamicAnddynamicAnddynamic__Todynamic = () => (dynamicAnddynamicAnddynamic__Todynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic, dart.dynamic, dart.dynamic])))();
+ list_is_test.A$ = dart.generic(T => {
+ let ListOfT = () => (ListOfT = dart.constFn(core.List$(T)))();
+ class A extends core.Object {
+ bar() {
+ return ListOfT().new();
+ }
+ }
+ dart.addTypeTests(A);
+ dart.setSignature(A, {
+ methods: () => ({bar: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ return A;
+ });
+ list_is_test.A = A();
+ list_is_test.main = function() {
+ list_is_test.check(core.List.new(), true, true, true);
+ list_is_test.check(ListOfint().new(), true, true, false);
+ list_is_test.check(new list_is_test.A().bar(), true, true, true);
+ list_is_test.check(new (AOfdouble())().bar(), true, false, true);
+ list_is_test.check(new core.Object(), false, false, false);
+ };
+ dart.fn(list_is_test.main, VoidTodynamic());
+ list_is_test.check = function(val, expectList, expectListInt, expectListDouble) {
+ expect$.Expect.equals(expectList, core.List.is(val));
+ expect$.Expect.equals(expectListInt, ListOfint().is(val));
+ expect$.Expect.equals(expectListDouble, ListOfdouble().is(val));
+ };
+ dart.fn(list_is_test.check, dynamicAnddynamicAnddynamic__Todynamic());
+ // Exports:
+ exports.list_is_test = list_is_test;
+});
« no previous file with comments | « test/codegen/expect/language/list_in_closure_test.js ('k') | test/codegen/expect/language/list_length_tracer_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698