From 29d206999f91b2f70c77e26052e73cd6448bb1e2 Mon Sep 17 00:00:00 2001 From: Younies Mahmoud Date: Tue, 21 Jan 2025 15:04:07 +0100 Subject: [PATCH] Remove non-acceptable constant denominator test case from MeasureUnitTest --- .../icu/dev/test/format/MeasureUnitTest.java | 31 ++----------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitTest.java b/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitTest.java index a45d6d169e9e..4efef2f623d4 100644 --- a/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitTest.java +++ b/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitTest.java @@ -1392,33 +1392,6 @@ class ConstantDenominatorTestCase { } } - @Test - public void TestNonAcceptableConstantDenominator() { - class NonAcceptableConstantDenominatorTestCase { - String identifier; - - NonAcceptableConstantDenominatorTestCase(String identifier) { - this.identifier = identifier; - } - } - - List testCases = Arrays.asList( - new NonAcceptableConstantDenominatorTestCase("meter-and-second"), - new NonAcceptableConstantDenominatorTestCase("meter-per--20--second"), - new NonAcceptableConstantDenominatorTestCase("meter-per-1000-1e9-second"), - new NonAcceptableConstantDenominatorTestCase("meter-per-1e20-second")); - - for (NonAcceptableConstantDenominatorTestCase testCase : testCases) { - try { - MeasureUnit unit = MeasureUnit.forIdentifier(testCase.identifier); - unit.getConstantDenominator(); - Assert.fail("An IllegalArgumentException must be thrown"); - } catch (Exception e) { - continue; - } - } - } - @Test public void TestInvalidIdentifiers() { final String inputs[] = { @@ -1458,6 +1431,9 @@ public void TestInvalidIdentifiers() { "kilonewton-meter-and-newton-meter", // Invalid units because of invalid constant denominator + "meter-per--20--second", + "meter-per-1000-1e9-second", + "meter-per-1e20-second", "per-1000", "meter-per-1000-1000", "meter-per-1000-second-1000-kilometer", @@ -1466,7 +1442,6 @@ public void TestInvalidIdentifiers() { "meter-per-1000-1000", "meter-per-1000-second-1000-kilometer", "per-1000-and-per-1000", - }; for (String input : inputs) {