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

Unified Diff: test/codegen/expect/corelib/has_next_iterator_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/growable_list_test.js ('k') | test/codegen/expect/corelib/hash_map2_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/corelib/has_next_iterator_test.js
diff --git a/test/codegen/expect/corelib/has_next_iterator_test.js b/test/codegen/expect/corelib/has_next_iterator_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..73099616e55fdd029650460689a367d88619cc57
--- /dev/null
+++ b/test/codegen/expect/corelib/has_next_iterator_test.js
@@ -0,0 +1,46 @@
+dart_library.library('corelib/has_next_iterator_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__has_next_iterator_test(exports, dart_sdk, expect) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const collection = dart_sdk.collection;
+ const _interceptors = dart_sdk._interceptors;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const has_next_iterator_test = Object.create(null);
+ let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(core.int)))();
+ let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [])))();
+ let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionType(core.bool, [dart.dynamic])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ has_next_iterator_test.main = function() {
+ let it = new collection.HasNextIterator([][dartx.iterator]);
+ expect$.Expect.isFalse(it.hasNext);
+ expect$.Expect.isFalse(it.hasNext);
+ expect$.Expect.throws(dart.fn(() => it.next(), VoidTovoid()), dart.fn(e => core.StateError.is(e), dynamicTobool()));
+ expect$.Expect.isFalse(it.hasNext);
+ it = new collection.HasNextIterator(JSArrayOfint().of([1])[dartx.iterator]);
+ expect$.Expect.isTrue(it.hasNext);
+ expect$.Expect.isTrue(it.hasNext);
+ expect$.Expect.equals(1, it.next());
+ expect$.Expect.isFalse(it.hasNext);
+ expect$.Expect.isFalse(it.hasNext);
+ expect$.Expect.throws(dart.fn(() => it.next(), VoidTovoid()), dart.fn(e => core.StateError.is(e), dynamicTobool()));
+ expect$.Expect.isFalse(it.hasNext);
+ it = new collection.HasNextIterator(JSArrayOfint().of([1, 2])[dartx.iterator]);
+ expect$.Expect.isTrue(it.hasNext);
+ expect$.Expect.isTrue(it.hasNext);
+ expect$.Expect.equals(1, it.next());
+ expect$.Expect.isTrue(it.hasNext);
+ expect$.Expect.isTrue(it.hasNext);
+ expect$.Expect.equals(2, it.next());
+ expect$.Expect.isFalse(it.hasNext);
+ expect$.Expect.isFalse(it.hasNext);
+ expect$.Expect.throws(dart.fn(() => it.next(), VoidTovoid()), dart.fn(e => core.StateError.is(e), dynamicTobool()));
+ expect$.Expect.isFalse(it.hasNext);
+ };
+ dart.fn(has_next_iterator_test.main, VoidTodynamic());
+ // Exports:
+ exports.has_next_iterator_test = has_next_iterator_test;
+});
« no previous file with comments | « test/codegen/expect/corelib/growable_list_test.js ('k') | test/codegen/expect/corelib/hash_map2_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698