ICU-20186 Adding test for leading and trailing spaces in DecimalFormat.

This commit is contained in:
Shane Carr 2018-11-26 17:01:32 -08:00 committed by Shane F. Carr
parent 00b360227b
commit bb2b390b87
2 changed files with 8 additions and 0 deletions

View File

@ -411,6 +411,10 @@ void NumberFormatTest::Test20186_SpacesAroundSemicolon() {
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
df = DecimalFormat(u" 0.00 ; -0.00 ", {"en-us", status}, status);
expect2(df, 1, u" 1.00 ");
expect2(df, -1, u" -1.00 ");
}
/*

View File

@ -270,6 +270,10 @@ public class NumberFormatTest extends TestFmwk {
df = new DecimalFormat("0.00;0.00");
expect2(df, 1, "1.00");
expect(df, -1, "1.00"); // parses as 1, not -1
df = new DecimalFormat(" 0.00 ; -0.00 ");
expect2(df, 1, " 1.00 ");
expect2(df, -1, " -1.00 ");
}
// Test exponential pattern