diff --git a/src/test/java/org/djunits/unit/si/SIRuntimeExceptionTest.java b/src/test/java/org/djunits/unit/si/SIRuntimeExceptionTest.java index 3c5a581..80cf941 100644 --- a/src/test/java/org/djunits/unit/si/SIRuntimeExceptionTest.java +++ b/src/test/java/org/djunits/unit/si/SIRuntimeExceptionTest.java @@ -5,6 +5,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import org.djunits.unit.SpeedUnit; import org.djunits.unit.Unit; import org.junit.Test; @@ -84,6 +85,10 @@ public void testException() @Test public void testUnitGetUnit() { + assertTrue(Unit.getUnit("").getQuantity().getSiDimensions().equals(SIDimensions.DIMLESS)); + assertTrue(Unit.getUnit("m/s").getQuantity().getSiDimensions() + .equals(SpeedUnit.METER_PER_SECOND.getQuantity().getSiDimensions())); + try { Unit.getUnit(null); @@ -94,16 +99,6 @@ public void testUnitGetUnit() assertTrue("Exception describes the parameter that has the problem", npe.getMessage().contains("unitString")); } - try - { - Unit.getUnit(""); - fail("empty string should have thrown a IllegalArgumentException"); - } - catch (IllegalArgumentException npe) - { - assertTrue("Exception describes the parameter that has the problem", npe.getMessage().contains("unitString")); - } - try { Unit.getUnit("m.m.m.m"); diff --git a/src/test/java/org/djunits/value/vdouble/matrix/DoubleMatrixMethodTest.java b/src/test/java/org/djunits/value/vdouble/matrix/DoubleMatrixMethodTest.java index dc32025..d41c07c 100644 --- a/src/test/java/org/djunits/value/vdouble/matrix/DoubleMatrixMethodTest.java +++ b/src/test/java/org/djunits/value/vdouble/matrix/DoubleMatrixMethodTest.java @@ -417,7 +417,7 @@ public void testMatrixMethods() throws ValueRuntimeException, UnitException SIMatrix amDiv = am.divide(am2); assertEquals("unit of m2 * m2 should be m4", "m4", amTim.getDisplayUnit().getQuantity().getSiDimensions().toString(false, false, false)); - assertEquals("unit of m2 / m2 should be 1", "1", + assertEquals("unit of m2 / m2 should be empty string", "", amDiv.getDisplayUnit().getQuantity().getSiDimensions().toString(false, false, false)); for (int row = 0; row < testData.length; row++) {