TESTCASE_AUTO(TestQuotes);
TESTCASE_AUTO(TestExponential);
TESTCASE_AUTO(TestPatterns);
+ TESTCASE_AUTO(Test20186_SpacesAroundSemicolon);
// Upgrade to alphaWorks - liu 5/99
TESTCASE_AUTO(TestExponent);
}
}
+void NumberFormatTest::Test20186_SpacesAroundSemicolon() {
+ IcuTestErrorCode status(*this, "Test20186_SpacesAroundSemicolon");
+ DecimalFormat df(u"0.00 ; -0.00", {"en-us", status}, status);
+ expect2(df, 1, u"1.00 ");
+ expect2(df, -1, u" -1.00");
+
+ df = DecimalFormat(u"0.00;", {"en-us", status}, status);
+ expect2(df, 1, u"1.00");
+ expect2(df, -1, u"-1.00");
+
+ df = DecimalFormat(u"0.00;0.00", {"en-us", status}, status);
+ expect2(df, 1, u"1.00");
+ expect(df, -1, u"1.00"); // parses as 1, not -1
+}
+
/*
icu_2_4::DigitList::operator== 0 0 2 icuuc24d.dll digitlst.cpp Doug
icu_2_4::DigitList::append 0 0 4 icuin24d.dll digitlst.h Doug
}
}
+ @Test
+ public void Test20186_SpacesAroundSemicolon() {
+ DecimalFormat df = new DecimalFormat("0.00 ; -0.00");
+ expect2(df, 1, "1.00 ");
+ expect2(df, -1, " -1.00");
+
+ df = new DecimalFormat("0.00;");
+ expect2(df, 1, "1.00");
+ expect2(df, -1, "-1.00");
+
+ df = new DecimalFormat("0.00;0.00");
+ expect2(df, 1, "1.00");
+ expect(df, -1, "1.00"); // parses as 1, not -1
+ }
+
// Test exponential pattern
@Test
public void TestExponential() {