diff --git a/src/test/java/tech/units/indriya/format/EBNFFormatTest.java b/src/test/java/tech/units/indriya/format/EBNFFormatTest.java index 735e477b..31cc8232 100644 --- a/src/test/java/tech/units/indriya/format/EBNFFormatTest.java +++ b/src/test/java/tech/units/indriya/format/EBNFFormatTest.java @@ -126,7 +126,6 @@ public void testFormatN() { } @Test - // TODO address https://github.com/unitsofmeasurement/uom-se/issues/145 public void testFormatmm() { final String s = format.format(MILLI(METRE)); assertEquals("mm", s); diff --git a/src/test/java/tech/units/indriya/format/EBNFPrefixTest.java b/src/test/java/tech/units/indriya/format/EBNFPrefixTest.java index 225726e6..376b2e68 100644 --- a/src/test/java/tech/units/indriya/format/EBNFPrefixTest.java +++ b/src/test/java/tech/units/indriya/format/EBNFPrefixTest.java @@ -41,6 +41,7 @@ import static tech.units.indriya.unit.Units.METRE; import javax.measure.Quantity; +import javax.measure.Unit; import javax.measure.format.UnitFormat; import javax.measure.quantity.Length; import javax.measure.quantity.Mass; @@ -64,8 +65,6 @@ static void init() { @Test public void testKilo() { - // TODO how to handle equals for units? - // assertEquals(KILOGRAM.getSymbol(), KILO(GRAM).getSymbol()); assertEquals(format.format(KILOGRAM), format.format(KILO(GRAM))); } @@ -124,7 +123,7 @@ public void testMilli4() { } @Test - public void testMicro2() { + public void testMicro() { Quantity m1 = Quantities.getQuantity(1.0, Units.METRE); assertNumberEquals(1d, m1.getValue(), 1E-12); assertEquals("m", format.format(m1.getUnit())); @@ -161,11 +160,39 @@ public void testQuetta() { assertEquals("Ql", format.format(QUETTA(LITRE))); } + @Test + public void testRonna() { + assertEquals("Rm", format.format(RONNA(METRE))); + } + + @Test + public void testQuecto() { + assertEquals("ql", format.format(QUECTO(LITRE))); + } + @Test public void testRonto() { assertEquals("rg", format.format(RONTO(GRAM))); } - + + @Test + public void testPArseMilli() { + final Unit m = format.parse("mg"); + assertEquals(m, MILLI(Units.GRAM)); + } + + @Test + public void testParseRonna() { + final Unit l = format.parse("Rm"); + assertEquals(l, RONNA(METRE)); + } + + @Test + public void testParseQuecto() { + final Unit v = format.parse("ql"); + assertEquals(v, QUECTO(LITRE)); + } + @Test public void testHashMapAccessingMap() { assertThat(LITRE.toString(), is("l")); @@ -227,4 +254,16 @@ public void testZebi() { public void testYobi() { assertEquals("Yig", format.format(YOBI(GRAM))); } + + @Test + public void testParseKibiL() { + final Unit v = format.parse("Kil"); + assertEquals(v, KIBI(LITRE)); + } + + @Test + public void testParseMebi() { + final Unit l = format.parse("Mim"); + assertEquals(l, MEBI(METRE)); + } }