You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "rakesh-das08 (via GitHub)" <gi...@apache.org> on 2023/06/03 16:29:48 UTC

[GitHub] [iceberg] rakesh-das08 commented on a diff in pull request #7758: Api: Switch tests to Junit5 (parent, types, util packages)

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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org