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(); |
-} |