rakesh-das08 commented on code in PR #7758:
URL: https://github.com/apache/iceberg/pull/7758#discussion_r1215637230
##########
api/src/test/java/org/apache/iceberg/types/TestCharSeqComparator.java:
##########
@@ -52,18 +53,20 @@ public void testSeqLength() {
Comparator<CharSequence> cmp = Literal.of(s1).comparator();
// Sanity check that String.compareTo gives the same result
- Assert.assertTrue(
- "When one string is a substring of the other, the longer is greater",
s1.compareTo(s2) < 0);
- Assert.assertTrue(
- "When one string is a substring of the other, the longer is greater",
s2.compareTo(s1) > 0);
+ assertThat(s1)
+ .as("When one string is a substring of the other, the longer is
greater")
+ .isLessThan(s2);
+ assertThat(s2)
+ .as("When one string is a substring of the other, the longer is
greater")
+ .isGreaterThan(s1);
// Test the comparator
- Assert.assertTrue(
- "When one string is a substring of the other, the longer is greater",
- cmp.compare(s1, s2) < 0);
- Assert.assertTrue(
- "When one string is a substring of the other, the longer is greater",
- cmp.compare(s2, s1) > 0);
+ assertThat(cmp.compare(s1, s2))
Review Comment:
The inconsistency is because of the method under test. At one place we are
testing `string.compareTo` whereas at one place we are testing the
`Comparator.compare` method.
Please let me know if am missing something.
Thank you.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]