Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Unified Diff: grit/format/android_xml_unittest.py

Issue 1258833004: Compile plural strings to android <plurals> elem (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: Added a test Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « grit/format/android_xml.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/format/android_xml_unittest.py
diff --git a/grit/format/android_xml_unittest.py b/grit/format/android_xml_unittest.py
index c5ce00f0d5c9896a2a0d92be0fa450b57918eeb7..adab8ca1c65408543eabfd80611eea9658cfaa24 100644
--- a/grit/format/android_xml_unittest.py
+++ b/grit/format/android_xml_unittest.py
@@ -50,6 +50,11 @@ a sledge hammer.
<message name="IDS_PLACEHOLDERS" desc="A string with placeholders">
I'll buy a <ph name="WAVELENGTH">%d<ex>200</ex></ph> nm laser at <ph name="STORE_NAME">%s<ex>the grocery store</ex></ph>.
</message>
+ <message name="IDS_PLURALS" desc="A string using the ICU plural format">
+ {NUM_THINGS, plural,
+ =1 {Maybe I'll get one laser.}
+ other {Maybe I'll get # lasers.}}
+ </message>
</messages>
""")
@@ -69,9 +74,13 @@ a sledge hammer."</string>
<string name="product_specific" product="nosdcard">"Lasers will probably be helpful."</string>
<string name="custom_name" product="default">"You have an SD card"</string>
<string name="placeholders">"I\'ll buy a %d nm laser at %s."</string>
+<plurals name="plurals">
+ <item quantity="one">"Maybe I\'ll get one laser."</item>
+ <item quantity="other">"Maybe I\'ll get %d lasers."</item>
+</plurals>
</resources>
"""
- self.assertEqual(output.strip(), expected.strip())
+ self.assertEqual(output.strip(), expected.strip(), msg=output.strip() + '\n' + expected.strip())
newt (away) 2015/08/04 18:15:11 why this custom msg? assertEqual() already prints
conleyo 2015/08/04 18:53:55 Sorry, debugging output. The standard string diff
conleyo 2015/08/04 22:56:14 Done.
def testTaggedOnly(self):
root = util.ParseGrdForUnittest(ur"""
« no previous file with comments | « grit/format/android_xml.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698