From 4d0a59a0023f2b4fca144a089a3f75acb4ebd62b Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Tue, 2 Jul 2019 18:32:37 -0400 Subject: Move tests to new package --- src/test/java/io/github/bculkin2442/TestUtils.java | 60 ---------------------- 1 file changed, 60 deletions(-) delete mode 100644 src/test/java/io/github/bculkin2442/TestUtils.java (limited to 'src/test/java/io/github/bculkin2442/TestUtils.java') diff --git a/src/test/java/io/github/bculkin2442/TestUtils.java b/src/test/java/io/github/bculkin2442/TestUtils.java deleted file mode 100644 index 80f7d96..0000000 --- a/src/test/java/io/github/bculkin2442/TestUtils.java +++ /dev/null @@ -1,60 +0,0 @@ -package io.github.bculkin2442; - -import java.util.Iterator; -import java.util.List; - -import static org.junit.Assert.*; - -public class TestUtils { - /** - * Assert an iterator provides a particular sequence of values. - * - * @param src - * The iterator to pull values from. - * @param vals - * The values to expect from the iterator. - */ - @SafeVarargs - public static void assertIteratorEquals(Iterator src, T... vals) { - for (T val : vals) { - assertEquals(val, src.next()); - } - } - - /** - * Assert an iterator provides a particular sequence of values. - * - * @param src - * The iterator to pull values from. - * @param hasMore - * The expected value of hasNext for the iterator. - * @param vals - * The values to expect from the iterator. - */ - @SafeVarargs - public static void assertIteratorEquals(boolean hasMore, Iterator src, T... vals) { - /* - * @NOTE - * - * Even though it's awkward, the boolean has to come first. - * Otherwise, there are cases where the compiler will get - * confused as to what the right value for T is, and be unable - * to pick an overload. - */ - assertIteratorEquals(src, vals); - - assertEquals("iterator not exhausted", hasMore, src.hasNext()); - } - - @SafeVarargs - public static void assertListEquals(List src, T... exps) { - assertEquals(exps.length, src.size()); - - int i = 0; - for (T act : src) { - T exp = exps[i++]; - - assertEquals(exp, act); - } - } -} -- cgit v1.2.3