diff options
author | Neil Fuller <nfuller@google.com> | 2014-06-17 10:43:47 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-06-17 04:34:38 +0000 |
commit | 7bc855c89a147c754b3d3367d9313a422ee1c277 (patch) | |
tree | a373cf26a626736b8c357e2f7efe68d31d917bcb | |
parent | 2b9311770bc531f15edb43f382696f3954a7c4e8 (diff) | |
parent | ba0592bae1be38bd29f5240c218ff5775f2cd933 (diff) | |
download | libcore-7bc855c89a147c754b3d3367d9313a422ee1c277.zip libcore-7bc855c89a147c754b3d3367d9313a422ee1c277.tar.gz libcore-7bc855c89a147c754b3d3367d9313a422ee1c277.tar.bz2 |
Merge "Add a test for bug 71369"
-rw-r--r-- | luni/src/test/java/libcore/java/text/DecimalFormatTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/luni/src/test/java/libcore/java/text/DecimalFormatTest.java b/luni/src/test/java/libcore/java/text/DecimalFormatTest.java index c58f83a..52b6fa2 100644 --- a/luni/src/test/java/libcore/java/text/DecimalFormatTest.java +++ b/luni/src/test/java/libcore/java/text/DecimalFormatTest.java @@ -260,4 +260,19 @@ public class DecimalFormatTest extends junit.framework.TestCase { } catch (NullPointerException expected) { } } + + // Confirm correct fractional digit handling in NumberFormat.getCurrencyInstance() / + // DecimalFormat. + public void testBug71369() { + final String nonBreakingSpace = "\u00A0"; + + NumberFormat numberFormat = NumberFormat.getCurrencyInstance(Locale.GERMAN); + numberFormat.setCurrency(Currency.getInstance("USD")); + + assertEquals("2,01" + nonBreakingSpace + "$", numberFormat.format(2.01)); + + numberFormat.setMinimumFractionDigits(0); + numberFormat.setMaximumFractionDigits(0); + assertEquals("2" + nonBreakingSpace + "$", numberFormat.format(2.01)); + } } |