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

Unified Diff: test/codegen/expect/corelib/list_index_of_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/corelib/list_index_of_test.js
diff --git a/test/codegen/expect/corelib/list_index_of_test.js b/test/codegen/expect/corelib/list_index_of_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..fb8aafe33c1788b3566b66951aedc14e25f00751
--- /dev/null
+++ b/test/codegen/expect/corelib/list_index_of_test.js
@@ -0,0 +1,42 @@
+dart_library.library('corelib/list_index_of_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__list_index_of_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_index_of_test = Object.create(null);
+ let ListOfint = () => (ListOfint = dart.constFn(core.List$(core.int)))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let ListOfintTovoid = () => (ListOfintTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [ListOfint()])))();
+ list_index_of_test.main = function() {
+ list_index_of_test.test(ListOfint().new(5));
+ let l = ListOfint().new();
+ l[dartx.length] = 5;
+ list_index_of_test.test(l);
+ };
+ dart.fn(list_index_of_test.main, VoidTodynamic());
+ list_index_of_test.test = function(list) {
+ list[dartx.set](0, 1);
+ list[dartx.set](1, 2);
+ list[dartx.set](2, 3);
+ list[dartx.set](3, 4);
+ list[dartx.set](4, 1);
+ expect$.Expect.equals(3, list[dartx.indexOf](4, 0));
+ expect$.Expect.equals(0, list[dartx.indexOf](1, 0));
+ expect$.Expect.equals(4, list[dartx.lastIndexOf](1, dart.notNull(list[dartx.length]) - 1));
+ expect$.Expect.equals(4, list[dartx.indexOf](1, 1));
+ expect$.Expect.equals(-1, list[dartx.lastIndexOf](4, 2));
+ expect$.Expect.equals(3, list[dartx.indexOf](4, 2));
+ expect$.Expect.equals(3, list[dartx.indexOf](4, -5));
+ expect$.Expect.equals(-1, list[dartx.indexOf](4, 50));
+ expect$.Expect.equals(-1, list[dartx.lastIndexOf](4, 2));
+ expect$.Expect.equals(-1, list[dartx.lastIndexOf](4, -5));
+ expect$.Expect.equals(3, list[dartx.lastIndexOf](4, 50));
+ };
+ dart.fn(list_index_of_test.test, ListOfintTovoid());
+ // Exports:
+ exports.list_index_of_test = list_index_of_test;
+});
« no previous file with comments | « test/codegen/expect/corelib/list_index_of2_test.js ('k') | test/codegen/expect/corelib/list_insert_all_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698