mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
新增api补齐单元测试
This commit is contained in:
parent
e59987a334
commit
77cc55a277
@ -252,4 +252,14 @@ public class NumberUtilTest {
|
||||
final BigDecimal mul = NumberUtil.mul(new BigDecimal("10"), null);
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user