Skip to content

Commit

Permalink
[#51] Added unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaseder committed Feb 28, 2018
1 parent 4373641 commit 1fdb6bc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jOOL/src/test/java/org/jooq/lambda/TupleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ public void testCompareToWithNulls() {
assertEquals(asList(tuple(1, "b"), tuple(1, null), tuple(2, "a"), tuple(null, "a"), tuple(null, "b"), tuple(null, null)), new ArrayList<>(set));
}

@Test
public void testCompareToWithNonComparables() {
Set<Tuple2<Integer, Object>> set = new TreeSet<>();
Utils.assertThrows(ClassCastException.class, () -> set.add(tuple(1, new Object())));
assertEquals(0, set.size());
}

@Test
public void testIterable() {
LinkedList<Object> list = new LinkedList<>(tuple(1, "b", null).toList());
Expand Down

0 comments on commit 1fdb6bc

Please sign in to comment.