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
4 # found in the LICENSE file.
9 class CppUtilTest(unittest
.TestCase
):
10 def testClassname(self
):
11 self
.assertEquals('Permissions', cpp_util
.Classname('permissions'))
12 self
.assertEquals('UpdateAllTheThings',
13 cpp_util
.Classname('updateAllTheThings'))
14 self
.assertEquals('Aa_Bb_Cc', cpp_util
.Classname('aa.bb.cc'))
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'
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())
30 if __name__
== '__main__':