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

Unified Diff: test/codegen/expect/corelib/map_values_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
« no previous file with comments | « test/codegen/expect/corelib/map_values4_test.js ('k') | test/codegen/expect/corelib/maps_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/corelib/map_values_test.js
diff --git a/test/codegen/expect/corelib/map_values_test.js b/test/codegen/expect/corelib/map_values_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..ee1e032dada38eff2cc7770247061c81c5ecbcf9
--- /dev/null
+++ b/test/codegen/expect/corelib/map_values_test.js
@@ -0,0 +1,54 @@
+dart_library.library('corelib/map_values_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__map_values_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 map_values_test = Object.create(null);
+ let MapOfString$int = () => (MapOfString$int = dart.constFn(core.Map$(core.String, core.int)))();
+ let MapOfString$bool = () => (MapOfString$bool = dart.constFn(core.Map$(core.String, core.bool)))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let const$;
+ let const$0;
+ map_values_test.main = function() {
+ let map1 = dart.map({foo: 42, bar: 499});
+ let map2 = dart.map();
+ let map3 = const$ || (const$ = dart.const(dart.map({foo: 42, bar: 499})));
+ let map4 = const$0 || (const$0 = dart.const(dart.map()));
+ let map5 = MapOfString$int().new();
+ map5[dartx.set]("foo", 43);
+ map5[dartx.set]("bar", 500);
+ let map6 = MapOfString$bool().new();
+ expect$.Expect.isTrue(core.Iterable.is(map1[dartx.values]));
+ expect$.Expect.isFalse(core.List.is(map1[dartx.values]));
+ expect$.Expect.equals(2, map1[dartx.values][dartx.length]);
+ expect$.Expect.equals(42, map1[dartx.values][dartx.first]);
+ expect$.Expect.equals(499, map1[dartx.values][dartx.last]);
+ expect$.Expect.isTrue(core.Iterable.is(map2[dartx.values]));
+ expect$.Expect.isFalse(core.List.is(map2[dartx.values]));
+ expect$.Expect.equals(0, map2[dartx.values][dartx.length]);
+ expect$.Expect.isTrue(core.Iterable.is(map3[dartx.values]));
+ expect$.Expect.isFalse(core.List.is(map3[dartx.values]));
+ expect$.Expect.equals(2, map3[dartx.values][dartx.length]);
+ expect$.Expect.equals(42, map3[dartx.values][dartx.first]);
+ expect$.Expect.equals(499, map3[dartx.values][dartx.last]);
+ expect$.Expect.isTrue(core.Iterable.is(map4[dartx.values]));
+ expect$.Expect.isFalse(core.List.is(map4[dartx.values]));
+ expect$.Expect.equals(0, map4[dartx.values][dartx.length]);
+ expect$.Expect.isTrue(core.Iterable.is(map5[dartx.values]));
+ expect$.Expect.isFalse(core.List.is(map5[dartx.values]));
+ expect$.Expect.equals(2, map5[dartx.values][dartx.length]);
+ expect$.Expect.isTrue(map5[dartx.values][dartx.first] == 43 || map5[dartx.values][dartx.first] == 500);
+ expect$.Expect.isTrue(map5[dartx.values][dartx.last] == 43 || map5[dartx.values][dartx.last] == 500);
+ expect$.Expect.notEquals(map5[dartx.values][dartx.first], map5[dartx.values][dartx.last]);
+ expect$.Expect.isTrue(core.Iterable.is(map6[dartx.values]));
+ expect$.Expect.isFalse(core.List.is(map6[dartx.values]));
+ expect$.Expect.equals(0, map6[dartx.values][dartx.length]);
+ };
+ dart.fn(map_values_test.main, VoidTodynamic());
+ // Exports:
+ exports.map_values_test = map_values_test;
+});
« no previous file with comments | « test/codegen/expect/corelib/map_values4_test.js ('k') | test/codegen/expect/corelib/maps_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698