diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-10-29 20:07:42 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-10-29 20:07:42 -0400 |
| commit | 074393ed8abda6003f31b97496fa8195c4627753 (patch) | |
| tree | feca8ba07594c35df6ccfd260c2a107cec93ed79 /base/src/main/java/bjc/utils/funcutils/TestUtils.java | |
| parent | de3c396e8ebee90f584957725fa1757da4c6dda6 (diff) | |
More testing.
Add some more testing utilities
Diffstat (limited to 'base/src/main/java/bjc/utils/funcutils/TestUtils.java')
| -rw-r--r-- | base/src/main/java/bjc/utils/funcutils/TestUtils.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/base/src/main/java/bjc/utils/funcutils/TestUtils.java b/base/src/main/java/bjc/utils/funcutils/TestUtils.java index 124389e..586d366 100644 --- a/base/src/main/java/bjc/utils/funcutils/TestUtils.java +++ b/base/src/main/java/bjc/utils/funcutils/TestUtils.java @@ -38,20 +38,28 @@ public class TestUtils { * The values to expect from the iterator. */ @SafeVarargs - public static <T> void assertIteratorEquals(Iterator<T> src, boolean hasMore, T... vals) { + public static <T> void assertIteratorEquals(boolean hasMore, Iterator<T> 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(hasMore, src.hasNext()); } - + @SafeVarargs public static <T> void assertListEquals(List<T> src, T... exps) { assertEquals(exps.length, src.size()); - + int i = 0; for (T act : src) { T exp = exps[i++]; - + assertEquals(exp, act); } } |
