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

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

Issue 176993010: Start to implicitly include \n in rc_header_format. (Closed) Base URL: https://grit-i18n.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « grit/format/rc_header.py ('k') | grit/tool/build.py » ('j') | 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 '''Unit tests for the rc_header formatter''' 6 '''Unit tests for the rc_header formatter'''
7 7
8 # GRD samples exceed the 80 character limit. 8 # GRD samples exceed the 80 character limit.
9 # pylint: disable-msg=C6310 9 # pylint: disable-msg=C6310
10 10
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 # Using the default rc_header format string. 175 # Using the default rc_header format string.
176 output = rc_header.FormatDefines(grd, grd.ShouldOutputAllResourceDefines(), 176 output = rc_header.FormatDefines(grd, grd.ShouldOutputAllResourceDefines(),
177 grd.GetRcHeaderFormat()) 177 grd.GetRcHeaderFormat())
178 self.assertEqual(('#define IDR_LOGO 300\n' 178 self.assertEqual(('#define IDR_LOGO 300\n'
179 '#define IDS_GREETING 10000\n' 179 '#define IDS_GREETING 10000\n'
180 '#define IDS_BONGO 10001\n'), ''.join(output)) 180 '#define IDS_BONGO 10001\n'), ''.join(output))
181 181
182 # Using a custom rc_header format string. 182 # Using a custom rc_header format string.
183 grd.AssignRcHeaderFormat( 183 grd.AssignRcHeaderFormat(
184 '#define {textual_id} _Pragma("{textual_id}") {numeric_id}\n') 184 '#define {textual_id} _Pragma("{textual_id}") {numeric_id}')
185 output = rc_header.FormatDefines(grd, grd.ShouldOutputAllResourceDefines(), 185 output = rc_header.FormatDefines(grd, grd.ShouldOutputAllResourceDefines(),
186 grd.GetRcHeaderFormat()) 186 grd.GetRcHeaderFormat())
187 self.assertEqual(('#define IDR_LOGO _Pragma("IDR_LOGO") 300\n' 187 self.assertEqual(('#define IDR_LOGO _Pragma("IDR_LOGO") 300\n'
188 '#define IDS_GREETING _Pragma("IDS_GREETING") 10000\n' 188 '#define IDS_GREETING _Pragma("IDS_GREETING") 10000\n'
189 '#define IDS_BONGO _Pragma("IDS_BONGO") 10001\n'), 189 '#define IDS_BONGO _Pragma("IDS_BONGO") 10001\n'),
190 ''.join(output)) 190 ''.join(output))
191 191
192 if __name__ == '__main__': 192 if __name__ == '__main__':
193 unittest.main() 193 unittest.main()
OLDNEW
« no previous file with comments | « grit/format/rc_header.py ('k') | grit/tool/build.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698