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

Unified Diff: grit/tool/build_unittest.py

Issue 9958067: Fixing a bug in GRIT where messages with substitutions would (Closed) Base URL: https://grit-i18n.googlecode.com/svn/trunk
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « grit/tool/build.py ('k') | grit/tool/postprocess_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/tool/build_unittest.py
diff --git a/grit/tool/build_unittest.py b/grit/tool/build_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..92728de05b2818c6bdbfc2dc3bd84aaecb51a0fe
--- /dev/null
+++ b/grit/tool/build_unittest.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+'''Unit tests for the 'grit build' tool.
+'''
+
+import os
+import re
+import sys
+import tempfile
+if __name__ == '__main__':
+ sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
+
+import unittest
+
+from grit import util
+from grit.tool import build
+
+
+class BuildUnittest(unittest.TestCase):
+
+ def testFindTranslationsWithSubstitutions(self):
+ # This is a regression test; we had a bug where GRIT would fail to find
+ # messages with substitutions e.g. "Hello [IDS_USER]" where IDS_USER is
+ # another <message>.
+ output_dir = tempfile.mkdtemp()
+ builder = build.RcBuilder()
+ class DummyOpts(object):
+ def __init__(self):
+ self.input = util.PathFromRoot('grit/testdata/substitute.grd')
+ self.verbose = False
+ self.extra_verbose = False
+ builder.Run(DummyOpts(), ['-o', output_dir])
+
+
+if __name__ == '__main__':
+ unittest.main()
« no previous file with comments | « grit/tool/build.py ('k') | grit/tool/postprocess_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698