andreachild commented on code in PR #3117:
URL: https://github.com/apache/tinkerpop/pull/3117#discussion_r2082116436


##########
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/util/NumberHelperTest.java:
##########
@@ -460,22 +484,68 @@ public void testMinMaxCompare() {
         }
     }
 
+    @Test
+    public void shouldPromoteFloatToDoubleForSum() {
+        Number value = add(Float.MAX_VALUE, Float.MAX_VALUE);
+        assertTrue(value instanceof Double);
+        assertFalse(Double.isInfinite(value.doubleValue()));
+    }
+
+    @Test
+    public void shouldPromoteDoubleToInfiniteForSum() {
+        Number value = add(Double.MAX_VALUE, Double.MAX_VALUE);
+        assertTrue(value instanceof Double);
+        assertTrue(Double.isInfinite(value.doubleValue()));
+    }
+
+    @Test
+    public void shouldPromoteFloatToDoubleForMul() {
+        Number value = mul(Float.MAX_VALUE, 2F);
+        assertTrue(value instanceof Double);
+        assertFalse(Double.isInfinite(value.doubleValue()));
+    }
+
+    @Test
+    public void shouldPromoteDoubleToInfiniteForMul() {
+        Number value = mul(Double.MAX_VALUE, 2F);
+        assertTrue(value instanceof Double);
+        assertTrue(Double.isInfinite(value.doubleValue()));
+    }
+
     @Test
     public void shouldThrowArithmeticExceptionOnOverflow() {
-        for (final Triplet<Number, Number, String> q : OVERFLOW_CASES) {
+        for (final Quartet<Number, Number, String, Boolean> q : 
OVERFLOW_CASES) {
+            if (!q.getValue3()) {

Review Comment:
   From what I can tell, having a `q=false` in the test data set essentially is 
the same as removing the entire quartet value from the data set as this check 
will just skip execution of the test case.
   
   If my understanding is correct then I would recommend separating the test 
cases that have `q=false` from the `OVERFLOW_CASES` data set into their own 
unit test as those entries are not actually executed.



-- 
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]

Reply via email to