summaryrefslogtreecommitdiffstats
path: root/harmony-tests
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2015-02-18 15:44:01 +0000
committerNarayan Kamath <narayan@google.com>2015-02-18 15:44:01 +0000
commit0f702b5996488b8cc8cbe336e8098dd1b4de8dd3 (patch)
tree9d58e4d199209a3b02f1a31a6bae7aeddf2d9517 /harmony-tests
parent76f9f6402ffb9fd069f494d16a61b8652ec85c81 (diff)
downloadlibcore-0f702b5996488b8cc8cbe336e8098dd1b4de8dd3.zip
libcore-0f702b5996488b8cc8cbe336e8098dd1b4de8dd3.tar.gz
libcore-0f702b5996488b8cc8cbe336e8098dd1b4de8dd3.tar.bz2
Deal with quoted subformat patterns correctly.
This change might look like a hack, but the API it implements is more than worthy of it. bug: 19011159 Change-Id: I8a539f1b54282220fbb0a005a750819fa7873cc9
Diffstat (limited to 'harmony-tests')
-rw-r--r--harmony-tests/src/test/java/org/apache/harmony/tests/java/text/MessageFormatTest.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/MessageFormatTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/MessageFormatTest.java
index 171f247..0920714 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/MessageFormatTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/MessageFormatTest.java
@@ -950,4 +950,12 @@ public class MessageFormatTest extends TestCase {
String res = MessageFormat.format("bgcolor=\"{10}\"", messageArgs);
assertEquals(res, "bgcolor=\"example10\"");
}
+
+ // http://b/19011159
+ public void test19011159() {
+ final String pattern = "ab{0,choice,0#1'2''3'''4''''.}yz";
+ final MessageFormat format = new MessageFormat(pattern, Locale.ENGLISH);
+ final Object[] zero0 = new Object[] { 0 };
+ assertEquals("ab12'3'4''.yz", format.format(zero0));
+ }
}