am 776e5d45: Merge "Sync DecimalFormatTest with the internal tree."
* commit '776e5d45dd4a4fdc0e5eb6a6cb29e2fbf111c2f9':
Sync DecimalFormatTest with the internal tree.
diff --git a/luni/src/test/java/libcore/java/text/DecimalFormatTest.java b/luni/src/test/java/libcore/java/text/DecimalFormatTest.java
index dbcb1c8..1e40f8a 100644
--- a/luni/src/test/java/libcore/java/text/DecimalFormatTest.java
+++ b/luni/src/test/java/libcore/java/text/DecimalFormatTest.java
@@ -173,6 +173,24 @@
assertEquals(expectedResult, df.format(d));
}
+ public void testSetZeroDigitForPattern() {
+ DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols();
+ decimalFormatSymbols.setZeroDigit('a');
+ DecimalFormat formatter = new DecimalFormat();
+ formatter.setDecimalFormatSymbols(decimalFormatSymbols);
+ formatter.applyLocalizedPattern("#.aa");
+ assertEquals("e.fa", formatter.format(4.50));
+ }
+
+ public void testSetZeroDigitForFormatting() {
+ DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols();
+ decimalFormatSymbols.setZeroDigit('a');
+ DecimalFormat formatter = new DecimalFormat();
+ formatter.setDecimalFormatSymbols(decimalFormatSymbols);
+ formatter.applyLocalizedPattern("#");
+ assertEquals("eadacab", formatter.format(4030201));
+ }
+
public void testBug9087737() throws Exception {
DecimalFormat df = (DecimalFormat) NumberFormat.getCurrencyInstance(Locale.US);
// These shouldn't make valgrind unhappy.