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

Side by Side Diff: grit/format/chrome_messages_json_unittest.py

Issue 1425693007: Fix placeholder syntax for Chrome extensions. (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: Added unit test. Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « grit/format/chrome_messages_json.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Unittest for chrome_messages_json.py. 6 """Unittest for chrome_messages_json.py.
7 """ 7 """
8 8
9 import os 9 import os
10 import sys 10 import sys
(...skipping 14 matching lines...) Expand all
25 <messages> 25 <messages>
26 <message name="IDS_SIMPLE_MESSAGE"> 26 <message name="IDS_SIMPLE_MESSAGE">
27 Simple message. 27 Simple message.
28 </message> 28 </message>
29 <message name="IDS_QUOTES"> 29 <message name="IDS_QUOTES">
30 element\u2019s \u201c<ph name="NAME">%s<ex>name</ex></ph>\u201d at tribute 30 element\u2019s \u201c<ph name="NAME">%s<ex>name</ex></ph>\u201d at tribute
31 </message> 31 </message>
32 <message name="IDS_PLACEHOLDERS"> 32 <message name="IDS_PLACEHOLDERS">
33 <ph name="ERROR_COUNT">%1$d<ex>1</ex></ph> error, <ph name="WARNIN G_COUNT">%2$d<ex>1</ex></ph> warning 33 <ph name="ERROR_COUNT">%1$d<ex>1</ex></ph> error, <ph name="WARNIN G_COUNT">%2$d<ex>1</ex></ph> warning
34 </message> 34 </message>
35 <message name="IDS_PLACEHOLDERS_SUBSTITUTED_BY_GETMESSAGE">
36 <ph name="BEGIN">$1<ex>a</ex></ph>test<ph name="END">$2<ex>b</ex>< /ph>
37 </message>
35 <message name="IDS_STARTS_WITH_SPACE"> 38 <message name="IDS_STARTS_WITH_SPACE">
36 ''' (<ph name="COUNT">%d<ex>2</ex></ph>) 39 ''' (<ph name="COUNT">%d<ex>2</ex></ph>)
37 </message> 40 </message>
38 <message name="IDS_ENDS_WITH_SPACE"> 41 <message name="IDS_ENDS_WITH_SPACE">
39 (<ph name="COUNT">%d<ex>2</ex></ph>) ''' 42 (<ph name="COUNT">%d<ex>2</ex></ph>) '''
40 </message> 43 </message>
41 <message name="IDS_SPACE_AT_BOTH_ENDS"> 44 <message name="IDS_SPACE_AT_BOTH_ENDS">
42 ''' (<ph name="COUNT">%d<ex>2</ex></ph>) ''' 45 ''' (<ph name="COUNT">%d<ex>2</ex></ph>) '''
43 </message> 46 </message>
44 <message name="IDS_DOUBLE_QUOTES"> 47 <message name="IDS_DOUBLE_QUOTES">
(...skipping 12 matching lines...) Expand all
57 { 60 {
58 "SIMPLE_MESSAGE": { 61 "SIMPLE_MESSAGE": {
59 "message": "Simple message." 62 "message": "Simple message."
60 }, 63 },
61 "QUOTES": { 64 "QUOTES": {
62 "message": "element\\u2019s \\u201c%s\\u201d attribute" 65 "message": "element\\u2019s \\u201c%s\\u201d attribute"
63 }, 66 },
64 "PLACEHOLDERS": { 67 "PLACEHOLDERS": {
65 "message": "%1$d error, %2$d warning" 68 "message": "%1$d error, %2$d warning"
66 }, 69 },
70 "PLACEHOLDERS_SUBSTITUTED_BY_GETMESSAGE": {
71 "message": "$1$test$2$",
72 "placeholders": {
73 "1": {
74 "content": "$1"
75 },
76 "2": {
77 "content": "$2"
78 }
79 }
80 },
67 "STARTS_WITH_SPACE": { 81 "STARTS_WITH_SPACE": {
68 "message": " (%d)" 82 "message": " (%d)"
69 }, 83 },
70 "ENDS_WITH_SPACE": { 84 "ENDS_WITH_SPACE": {
71 "message": "(%d) " 85 "message": "(%d) "
72 }, 86 },
73 "SPACE_AT_BOTH_ENDS": { 87 "SPACE_AT_BOTH_ENDS": {
74 "message": " (%d) " 88 "message": " (%d) "
75 }, 89 },
76 "DOUBLE_QUOTES": { 90 "DOUBLE_QUOTES": {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 133
120 def GetLanguage(self): 134 def GetLanguage(self):
121 return self.language 135 return self.language
122 136
123 def GetOutputFilename(self): 137 def GetOutputFilename(self):
124 return 'hello.gif' 138 return 'hello.gif'
125 139
126 140
127 if __name__ == '__main__': 141 if __name__ == '__main__':
128 unittest.main() 142 unittest.main()
OLDNEW
« no previous file with comments | « grit/format/chrome_messages_json.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698