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

Unified Diff: tests/corelib_strong/iterable_generate_test.dart

Issue 3000543002: Migrate test block 11 to Dart 2.0. (Closed)
Patch Set: Fix merge problems and update test status with head changes Created 3 years, 4 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 | « tests/corelib_strong/corelib_strong_kernel.status ('k') | tests/corelib_strong/iterable_join_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib_strong/iterable_generate_test.dart
diff --git a/tests/corelib_strong/iterable_generate_test.dart b/tests/corelib_strong/iterable_generate_test.dart
deleted file mode 100644
index d6147a834744f3286790199e513559ec0470f47a..0000000000000000000000000000000000000000
--- a/tests/corelib_strong/iterable_generate_test.dart
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import "package:expect/expect.dart";
-
-main() {
- bool checkedMode = false;
- assert((checkedMode = true));
- void test(expectedList, generatedIterable) {
- Expect.equals(expectedList.length, generatedIterable.length);
- Expect.listEquals(expectedList, generatedIterable.toList());
- }
-
- test([], new Iterable.generate(0));
- test([0], new Iterable.generate(1));
- test([0, 1, 2, 3, 4], new Iterable.generate(5));
- test(["0", "1", "2", "3", "4"], new Iterable.generate(5, (x) => "$x"));
- test([2, 3, 4, 5, 6], new Iterable.generate(7).skip(2));
- test([0, 1, 2, 3, 4], new Iterable.generate(7).take(5));
- test([], new Iterable.generate(5).skip(6));
- test([], new Iterable.generate(5).take(0));
- test([], new Iterable.generate(5).take(3).skip(3));
- test([], new Iterable.generate(5).skip(6).take(0));
-
- // Test types.
-
- Iterable<int> it = new Iterable<int>.generate(5);
- Expect.isTrue(it is Iterable<int>);
- Expect.isTrue(it.iterator is Iterator<int>);
- Expect.isTrue(it is! Iterable<String>);
- Expect.isTrue(it.iterator is! Iterator<String>);
- test([0, 1, 2, 3, 4], it);
-
- Iterable<String> st = new Iterable<String>.generate(5, (x) => "$x");
- Expect.isTrue(st is Iterable<String>);
- Expect.isTrue(st.iterator is Iterator<String>);
- Expect.isFalse(st is Iterable<int>);
- Expect.isFalse(st.iterator is Iterator<int>);
- test(["0", "1", "2", "3", "4"], st);
-
- if (checkedMode) {
- Expect.throws(() => new Iterable<String>.generate(5));
- }
-}
« no previous file with comments | « tests/corelib_strong/corelib_strong_kernel.status ('k') | tests/corelib_strong/iterable_join_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698