diff options
author | Neil Fuller <nfuller@google.com> | 2014-06-18 16:16:00 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-06-17 21:55:36 +0000 |
commit | 36c0160226be643a0dcc98a25dc5543909555764 (patch) | |
tree | bd6a8a576b410a9944653d093d8b311da0cdd00a | |
parent | 7bc855c89a147c754b3d3367d9313a422ee1c277 (diff) | |
parent | 219af6ef9b40a39728f204ca20ebffdaa0a24ff7 (diff) | |
download | libcore-36c0160226be643a0dcc98a25dc5543909555764.zip libcore-36c0160226be643a0dcc98a25dc5543909555764.tar.gz libcore-36c0160226be643a0dcc98a25dc5543909555764.tar.bz2 |
Merge "Alter regression test for bug 71369 now the issue is understood"
-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)); } } |