diff options
author | Neil Fuller <nfuller@google.com> | 2014-06-18 16:22:54 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-06-18 16:22:54 +0000 |
commit | 4522f6031b7036b47861d1b1499ee3adf0f6d520 (patch) | |
tree | 7d7cd501d1a882b5da19554f396c95f2fd51b165 /luni/src/test | |
parent | 39ee4445ce87367c0ced05b19dfe3e3e65e4dd73 (diff) | |
parent | 36c0160226be643a0dcc98a25dc5543909555764 (diff) | |
download | libcore-4522f6031b7036b47861d1b1499ee3adf0f6d520.zip libcore-4522f6031b7036b47861d1b1499ee3adf0f6d520.tar.gz libcore-4522f6031b7036b47861d1b1499ee3adf0f6d520.tar.bz2 |
am 36c01602: Merge "Alter regression test for bug 71369 now the issue is understood"
* commit '36c0160226be643a0dcc98a25dc5543909555764':
Alter regression test for bug 71369 now the issue is understood
Diffstat (limited to 'luni/src/test')
-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)); } } |