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

Side by Side Diff: tools/json_schema_compiler/cpp_util_test.py

Issue 12041098: Initial commit of the Dart Chrome Extension APIs generators (Closed) Base URL: http://git.chromium.org/chromium/src.git@file_path_bugfix
Patch Set: Kalman fixes 2 (nocompile ignored in bundle mode) Created 7 years, 10 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
« no previous file with comments | « tools/json_schema_compiler/cpp_util.py ('k') | tools/json_schema_compiler/dart_generator.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 import cpp_util 6 import cpp_util
7 import unittest 7 import unittest
8 8
9 class CppUtilTest(unittest.TestCase): 9 class CppUtilTest(unittest.TestCase):
10 def testClassname(self): 10 def testClassname(self):
11 self.assertEquals('Permissions', cpp_util.Classname('permissions')) 11 self.assertEquals('Permissions', cpp_util.Classname('permissions'))
12 self.assertEquals('UpdateAllTheThings', 12 self.assertEquals('UpdateAllTheThings',
13 cpp_util.Classname('updateAllTheThings')) 13 cpp_util.Classname('updateAllTheThings'))
14 self.assertEquals('Aa_Bb_Cc', cpp_util.Classname('aa.bb.cc')) 14 self.assertEquals('Aa_Bb_Cc', cpp_util.Classname('aa.bb.cc'))
15 15
16 def testNamespaceDeclaration(self):
17 self.assertEquals('namespace extensions {',
18 cpp_util.OpenNamespace('extensions').Render())
19 self.assertEquals('} // namespace extensions',
20 cpp_util.CloseNamespace('extensions').Render())
21 self.assertEquals('namespace extensions {\n'
22 'namespace gen {\n'
23 'namespace api {',
24 cpp_util.OpenNamespace('extensions::gen::api').Render())
25 self.assertEquals('} // namespace api\n'
26 '} // namespace gen\n'
27 '} // namespace extensions',
28 cpp_util.CloseNamespace('extensions::gen::api').Render())
29
16 if __name__ == '__main__': 30 if __name__ == '__main__':
17 unittest.main() 31 unittest.main()
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/cpp_util.py ('k') | tools/json_schema_compiler/dart_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698