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

Unified Diff: tests/corelib/src/QueueIteratorTest.dart

Issue 10244009: test rename overhaul: step 7 - corelib tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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: tests/corelib/src/QueueIteratorTest.dart
diff --git a/tests/corelib/src/QueueIteratorTest.dart b/tests/corelib/src/QueueIteratorTest.dart
deleted file mode 100644
index 59c3b83030b7208b2d7bed70dcde74ab89e138aa..0000000000000000000000000000000000000000
--- a/tests/corelib/src/QueueIteratorTest.dart
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2011, 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.
-
-class QueueIteratorTest {
- static testMain() {
- testSmallQueue();
- testLargeQueue();
- testEmptyQueue();
- }
-
- static void testThrows(Iterator<int> it) {
- Expect.equals(false, it.hasNext());
- var exception = null;
- try {
- it.next();
- } catch (NoMoreElementsException e) {
- exception = e;
- }
- Expect.equals(true, exception != null);
- }
-
- static int sum(int expected, Iterator<int> it) {
- int count = 0;
- while (it.hasNext()) {
- count += it.next();
- }
- Expect.equals(expected, count);
- }
-
- static void testSmallQueue() {
- Queue<int> queue = new Queue<int>();
- queue.addLast(1);
- queue.addLast(2);
- queue.addLast(3);
-
- Iterator<int> it = queue.iterator();
- Expect.equals(true, it.hasNext());
- sum(6, it);
- testThrows(it);
- }
-
- static void testLargeQueue() {
- Queue<int> queue = new Queue<int>();
- int count = 0;
- for (int i = 0; i < 100; i++) {
- count += i;
- queue.addLast(i);
- }
- Iterator<int> it = queue.iterator();
- Expect.equals(true, it.hasNext());
- sum(count, it);
- testThrows(it);
- }
-
- static void testEmptyQueue() {
- Queue<int> queue = new Queue<int>();
- Iterator<int> it = queue.iterator();
- Expect.equals(false, it.hasNext());
- sum(0, it);
- testThrows(it);
- }
-}
-
-main() {
- QueueIteratorTest.testMain();
-}

Powered by Google App Engine
This is Rietveld 408576698