Skip to content

Commit c933c0b

Browse files
committedMar 2, 2025·
add varargs tests
1 parent c562879 commit c933c0b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
 

‎src/test/java/org/cactoos/iterable/SortedTest.java

+20
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,24 @@ void sortsByNymberComprator() {
8585
).affirm();
8686
}
8787

88+
@Test
89+
void sortsVarargs() {
90+
new Assertion<>(
91+
"Must sort varargs",
92+
new Sorted<>(10, 18, -10, 20, -2),
93+
Matchers.hasItems(-10, -2, 10, 18, 20)
94+
).affirm();
95+
}
96+
97+
@Test
98+
void sortsVarargsWithComparator() {
99+
new Assertion<>(
100+
"Must sort varargs with comparator",
101+
new Sorted<>(
102+
Comparator.reverseOrder(),
103+
-7, 0, 12, 1, -4
104+
),
105+
Matchers.hasItems(12, 1, 0, -4, -7)
106+
).affirm();
107+
}
88108
}

0 commit comments

Comments
 (0)
Please sign in to comment.