This commit is contained in:
Looly
2024-01-23 16:34:29 +08:00
parent f69a9db7b3
commit b7508cc0e9
11 changed files with 161 additions and 79 deletions

View File

@@ -10,8 +10,9 @@
* See the Mulan PSL v2 for more details.
*/
package org.dromara.hutool.core.convert;
package org.dromara.hutool.core.math;
import org.dromara.hutool.core.convert.Convert;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

View File

@@ -13,7 +13,6 @@
package org.dromara.hutool.core.math;
import org.dromara.hutool.core.lang.Console;
import org.dromara.hutool.core.math.NumberUtil;
import org.dromara.hutool.core.text.StrUtil;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@@ -380,6 +379,18 @@ public class NumberUtilTest {
Assertions.assertEquals(new BigDecimal("9.0E+7"), NumberUtil.toBigDecimal("9.0E+7"));
}
@Test
void emptyToBigDecimalTest(){
Assertions.assertThrows(IllegalArgumentException.class,()->{
NumberUtil.toBigDecimal("");
});
}
@Test
void naNToBigDecimalTest(){
Assertions.assertEquals(BigDecimal.ZERO, NumberUtil.toBigDecimal("NaN"));
}
@Test
public void issue2878Test() throws ParseException {
// https://github.com/dromara/hutool/issues/2878

View File

@@ -10,8 +10,9 @@
* See the Mulan PSL v2 for more details.
*/
package org.dromara.hutool.core.convert;
package org.dromara.hutool.core.math;
import org.dromara.hutool.core.math.NumberWordFormatter;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;