From 52fbe8cc4d0aa08ebf4ef15a7b93f630c6240b7f Mon Sep 17 00:00:00 2001 From: Zhangmei Li Date: Fri, 19 Mar 2021 19:49:34 +0800 Subject: [PATCH] improve comments Change-Id: I67c7b38979b2c0603878d48929247ec0282d10d9 --- .../com/baidu/hugegraph/unit/util/UnitUtilTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/java/com/baidu/hugegraph/unit/util/UnitUtilTest.java b/src/test/java/com/baidu/hugegraph/unit/util/UnitUtilTest.java index f7103190..a7e31e98 100644 --- a/src/test/java/com/baidu/hugegraph/unit/util/UnitUtilTest.java +++ b/src/test/java/com/baidu/hugegraph/unit/util/UnitUtilTest.java @@ -132,7 +132,7 @@ public void testBytesToGB() { value = UnitUtil.bytesToGB(Bytes.GB * 7357924680L); Assert.assertEquals(7357924680d, value, 0d); - // overflow + // Bytes overflow long value value = UnitUtil.bytesToGB(Bytes.GB * 9357924680L); Assert.assertEquals(-7.821944504E9, value, 0d); } @@ -337,7 +337,7 @@ public void testBytesToReadableString() { (long) (755 * 1.024) * Bytes.PB); Assert.assertEquals("7.75 EB", value); - // overflow + // Bytes overflow long value value = UnitUtil.bytesToReadableString(Bytes.EB * 8); Assert.assertEquals("0 B", value); } @@ -465,7 +465,7 @@ public void testBytesFromReadableString() { @Test public void testBytesFromReadableStringWithInvalidFormat() { - // no space + // No space Assert.assertThrows(IllegalArgumentException.class, () -> { UnitUtil.bytesFromReadableString("1kb"); }, e -> { @@ -473,7 +473,7 @@ public void testBytesFromReadableStringWithInvalidFormat() { e.getMessage()); }); - // invalid unit + // Invalid unit Assert.assertThrows(IllegalArgumentException.class, () -> { UnitUtil.bytesFromReadableString("1 aBc"); }, e -> { @@ -495,7 +495,7 @@ public void testBytesFromReadableStringWithInvalidFormat() { Assert.assertContains("Unrecognized unit 2 MB", e.getMessage()); }); - // invalid number + // Invalid number Assert.assertThrows(IllegalArgumentException.class, () -> { UnitUtil.bytesFromReadableString("2b kb"); }, e -> { @@ -509,7 +509,7 @@ public void testBytesFromReadableStringWithInvalidFormat() { e.getMessage()); }); - // overflow + // Bytes overflow long value Assert.assertThrows(IllegalArgumentException.class, () -> { UnitUtil.bytesFromReadableString("8.1 EIB"); }, e -> {