zabetak commented on code in PR #4054:
URL: https://github.com/apache/calcite/pull/4054#discussion_r1848041348
##########
core/src/test/java/org/apache/calcite/util/PartiallyOrderedSetTest.java:
##########
@@ -180,6 +181,32 @@ private static boolean isBitSuperset(Integer e1, Integer
e2) {
assertEqualsList("['ab', 'abcd']", poset.getAncestors("'a'"));
}
+ @Test void testGetNonParentsOnLteIntPosetReturnsMaxValue() {
+ PartiallyOrderedSet<Integer> poset =
+ new PartiallyOrderedSet<>((i, j) -> i <= j, Arrays.asList(20, 30, 40));
+ assertThat(poset.getNonParents(), hasToString("[40]"));
+ }
+
+ @Test void testGetNonChildrenOnLteIntPosetReturnsMinValue() {
+ PartiallyOrderedSet<Integer> poset =
+ new PartiallyOrderedSet<>((i, j) -> i <= j, Arrays.asList(20, 30, 40));
+ assertThat(poset.getNonChildren(), hasToString("[20]"));
+ }
+
+ @Test void testGetNonParentsOnGteIntPosetReturnsMinValue() {
+ PartiallyOrderedSet<Integer> poset =
+ new PartiallyOrderedSet<>((i, j) -> i >= j, Arrays.asList(20, 30, 40));
+ assertThat(poset.getNonParents(), hasToString("[20]"));
+ }
+
+ @Test void testGetNonChildrenOnGteIntPosetReturnsMaxValue() {
+ PartiallyOrderedSet<Integer> poset =
+ new PartiallyOrderedSet<>((i, j) -> i >= j, Arrays.asList(20, 30, 40));
+ printValidate(poset);
+ System.out.println(poset.getChildren(20));
Review Comment:
Thanks for catching this. I removed those in the last commit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]