diff options
author | Neil Fuller <nfuller@google.com> | 2014-06-18 17:05:32 +0100 |
---|---|---|
committer | Neil Fuller <nfuller@google.com> | 2014-06-18 17:06:50 +0100 |
commit | 219af6ef9b40a39728f204ca20ebffdaa0a24ff7 (patch) | |
tree | bd6a8a576b410a9944653d093d8b311da0cdd00a /luni/src/test/java | |
parent | 7bc855c89a147c754b3d3367d9313a422ee1c277 (diff) | |
download | libcore-219af6ef9b40a39728f204ca20ebffdaa0a24ff7.zip libcore-219af6ef9b40a39728f204ca20ebffdaa0a24ff7.tar.gz libcore-219af6ef9b40a39728f204ca20ebffdaa0a24ff7.tar.bz2 |
Alter regression test for bug 71369 now the issue is understood
The code was most likely fixed by an ICU update. This was added to
prevent regression. See the bug for details.
Bug: 71369
Change-Id: I8896334dfeac3a1dcb6379ac58510ede60f6b7c7
Diffstat (limited to 'luni/src/test/java')
-rw-r--r-- | luni/src/test/java/libcore/java/text/DecimalFormatTest.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/luni/src/test/java/libcore/java/text/DecimalFormatTest.java b/luni/src/test/java/libcore/java/text/DecimalFormatTest.java index 52b6fa2..722924d 100644 --- a/luni/src/test/java/libcore/java/text/DecimalFormatTest.java +++ b/luni/src/test/java/libcore/java/text/DecimalFormatTest.java @@ -261,8 +261,7 @@ public class DecimalFormatTest extends junit.framework.TestCase { } } - // Confirm correct fractional digit handling in NumberFormat.getCurrencyInstance() / - // DecimalFormat. + // Confirm the fraction digits do not change when the currency is changed. public void testBug71369() { final String nonBreakingSpace = "\u00A0"; @@ -273,6 +272,14 @@ public class DecimalFormatTest extends junit.framework.TestCase { numberFormat.setMinimumFractionDigits(0); numberFormat.setMaximumFractionDigits(0); - assertEquals("2" + nonBreakingSpace + "$", numberFormat.format(2.01)); + + String expected = "2" + nonBreakingSpace + "$"; + assertEquals(expected, numberFormat.format(2.01)); + + // Changing the currency must not reset the digits. + numberFormat.setCurrency(Currency.getInstance("EUR")); + numberFormat.setCurrency(Currency.getInstance("USD")); + + assertEquals(expected, numberFormat.format(2.01)); } } |