diff options
Diffstat (limited to 'src/test/java/sevenUnitsGUI/PrefixSearchTest.java')
-rw-r--r-- | src/test/java/sevenUnitsGUI/PrefixSearchTest.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/test/java/sevenUnitsGUI/PrefixSearchTest.java b/src/test/java/sevenUnitsGUI/PrefixSearchTest.java index b605d05..00dd960 100644 --- a/src/test/java/sevenUnitsGUI/PrefixSearchTest.java +++ b/src/test/java/sevenUnitsGUI/PrefixSearchTest.java @@ -40,9 +40,7 @@ import sevenUnits.unit.Metric; * @since v0.4.0 */ class PrefixSearchTest { - /** - * A method that creates duplicate copies of the common prefix rule. - */ + /** A method that creates duplicate copies of the common prefix rule. */ private static final PrefixSearchRule getCommonRuleCopy() { return getCoherentOnlyRule(Set.of(Metric.KILO, Metric.MILLI)); } @@ -110,7 +108,7 @@ class PrefixSearchTest { /** * Tests prefix searching for a non-coherent unit and * {@link PrefixSearchRule#COMMON_PREFIXES}. - * + * * @since 2022-07-17 * @since v0.4.0 */ @@ -125,7 +123,7 @@ class PrefixSearchTest { /** * Tests that {@link PrefixSearchRule#NO_PREFIXES} returns the original unit. - * + * * @since 2022-07-17 * @since v0.4.0 */ @@ -151,10 +149,10 @@ class PrefixSearchTest { */ @Test final void testToString() { - final String toString = COMMON_PREFIXES.toString(); - final String valid1 = "Apply the following prefixes: [kilo (\u00D7 1000.0), milli (\u00D7 0.001)]"; - final String valid2 = "Apply the following prefixes: [milli (\u00D7 0.001), kilo (\u00D7 1000.0)]"; - + final var toString = COMMON_PREFIXES.toString(); + final var valid1 = "Apply the following prefixes: [kilo (\u00D7 1000.0), milli (\u00D7 0.001)]"; + final var valid2 = "Apply the following prefixes: [milli (\u00D7 0.001), kilo (\u00D7 1000.0)]"; + assertTrue(valid1.equals(toString) || valid2.equals(toString), "COMMON_PREFIXES.toString invalid (was \"" + toString + "\")."); } |