mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
新增api补齐单元测试
This commit is contained in:
@@ -252,4 +252,14 @@ public class NumberUtilTest {
|
|||||||
final BigDecimal mul = NumberUtil.mul(new BigDecimal("10"), null);
|
final BigDecimal mul = NumberUtil.mul(new BigDecimal("10"), null);
|
||||||
Assert.assertEquals(BigDecimal.ZERO, mul);
|
Assert.assertEquals(BigDecimal.ZERO, mul);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void isPowerOfTwoTest() {
|
||||||
|
Assert.assertEquals(false, NumberUtil.isPowerOfTwo(-1));
|
||||||
|
Assert.assertEquals(true, NumberUtil.isPowerOfTwo(16));
|
||||||
|
Assert.assertEquals(true, NumberUtil.isPowerOfTwo(65536));
|
||||||
|
Assert.assertEquals(true, NumberUtil.isPowerOfTwo(1));
|
||||||
|
Assert.assertEquals(false, NumberUtil.isPowerOfTwo(17));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user