@@ -642,7 +642,7 @@ public void expm1_short_value(Short value) {
642642 }
643643
644644 /**
645- * Test expm1 with short value.
645+ * Test expm1 with byte value.
646646 */
647647 @ ParameterizedTest (name = "expm1({0})" )
648648 @ ValueSource (bytes = {
@@ -1570,6 +1570,92 @@ public void pow_null_missing() {
15701570 assertTrue (power .valueOf (valueEnv ()).isMissing ());
15711571 }
15721572
1573+ /**
1574+ * Test rint with byte value.
1575+ */
1576+ @ ParameterizedTest (name = "rint({0})" )
1577+ @ ValueSource (bytes = {
1578+ -1 , 0 , 1 , Byte .MAX_VALUE , Byte .MIN_VALUE })
1579+ public void rint_byte_value (Byte value ) {
1580+ FunctionExpression rint = DSL .rint (DSL .literal (value ));
1581+ assertThat (
1582+ rint .valueOf (valueEnv ()),
1583+ allOf (hasType (DOUBLE ), hasValue (Math .rint (value ))));
1584+ assertEquals (String .format ("rint(%s)" , value ), rint .toString ());
1585+ }
1586+
1587+ /**
1588+ * Test rint with short value.
1589+ */
1590+ @ ParameterizedTest (name = "rint({0})" )
1591+ @ ValueSource (shorts = {
1592+ -1 , 0 , 1 , Short .MAX_VALUE , Short .MIN_VALUE })
1593+ public void rint_short_value (Short value ) {
1594+ FunctionExpression rint = DSL .rint (DSL .literal (value ));
1595+ assertThat (
1596+ rint .valueOf (valueEnv ()),
1597+ allOf (hasType (DOUBLE ), hasValue (Math .rint (value ))));
1598+ assertEquals (String .format ("rint(%s)" , value ), rint .toString ());
1599+ }
1600+
1601+ /**
1602+ * Test rint with integer value.
1603+ */
1604+ @ ParameterizedTest (name = "rint({0})" )
1605+ @ ValueSource (ints = {
1606+ -1 , 0 , 1 , Integer .MAX_VALUE , Integer .MIN_VALUE })
1607+ public void rint_int_value (Integer value ) {
1608+ FunctionExpression rint = DSL .rint (DSL .literal (value ));
1609+ assertThat (
1610+ rint .valueOf (valueEnv ()),
1611+ allOf (hasType (DOUBLE ), hasValue (Math .rint (value ))));
1612+ assertEquals (String .format ("rint(%s)" , value ), rint .toString ());
1613+ }
1614+
1615+ /**
1616+ * Test rint with long value.
1617+ */
1618+ @ ParameterizedTest (name = "rint({0})" )
1619+ @ ValueSource (longs = {
1620+ -1L , 0L , 1L , Long .MAX_VALUE , Long .MIN_VALUE })
1621+ public void rint_long_value (Long value ) {
1622+ FunctionExpression rint = DSL .rint (DSL .literal (value ));
1623+ assertThat (
1624+ rint .valueOf (valueEnv ()),
1625+ allOf (hasType (DOUBLE ), hasValue (Math .rint (value ))));
1626+ assertEquals (String .format ("rint(%s)" , value ), rint .toString ());
1627+ }
1628+
1629+ /**
1630+ * Test rint with float value.
1631+ */
1632+ @ ParameterizedTest (name = "rint({0})" )
1633+ @ ValueSource (floats = {
1634+ -1F , -0.75F , -0.5F , 0F , 0.5F , 0.500000001F ,
1635+ 0.75F , 1F , 1.9999F , 42.42F , Float .MAX_VALUE , Float .MIN_VALUE })
1636+ public void rint_float_value (Float value ) {
1637+ FunctionExpression rint = DSL .rint (DSL .literal (value ));
1638+ assertThat (
1639+ rint .valueOf (valueEnv ()),
1640+ allOf (hasType (DOUBLE ), hasValue (Math .rint (value ))));
1641+ assertEquals (String .format ("rint(%s)" , value ), rint .toString ());
1642+ }
1643+
1644+ /**
1645+ * Test rint with double value.
1646+ */
1647+ @ ParameterizedTest (name = "rint({0})" )
1648+ @ ValueSource (doubles = {
1649+ -1F , -0.75F , -0.5F , 0F , 0.5F , 0.500000001F ,
1650+ 0.75F , 1F , 1.9999F , 42.42F , Double .MAX_VALUE , Double .MIN_VALUE })
1651+ public void rint_double_value (Double value ) {
1652+ FunctionExpression rint = DSL .rint (DSL .literal (value ));
1653+ assertThat (
1654+ rint .valueOf (valueEnv ()),
1655+ allOf (hasType (DOUBLE ), hasValue (Math .rint (value ))));
1656+ assertEquals (String .format ("rint(%s)" , value ), rint .toString ());
1657+ }
1658+
15731659 /**
15741660 * Test round with integer value.
15751661 */
0 commit comments