mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fixed #1155
This commit is contained in:
parent
d97db8c2e1
commit
29b6de444f
@ -30,6 +30,17 @@ public class DataSizeUtilTest {
|
|||||||
|
|
||||||
parse = DataSizeUtil.parse("3.1mb");
|
parse = DataSizeUtil.parse("3.1mb");
|
||||||
Assert.assertEquals(3250585, parse);
|
Assert.assertEquals(3250585, parse);
|
||||||
|
|
||||||
|
parse = DataSizeUtil.parse("3.1");
|
||||||
|
Assert.assertEquals(3, parse);
|
||||||
|
|
||||||
|
try {
|
||||||
|
parse = DataSizeUtil.parse("3.1.3");
|
||||||
|
} catch (IllegalArgumentException ie) {
|
||||||
|
Assert.assertEquals("'3.1.3' is not a valid data size", ie.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user