Index: tools/json_schema_compiler/cpp_util_test.py |
diff --git a/tools/json_schema_compiler/cpp_util_test.py b/tools/json_schema_compiler/cpp_util_test.py |
index def85d95d0a86b7d211e0965fc9b6340e9b5514b..ede309587f33b96322fe8c98ed55bd925fc1167f 100755 |
--- a/tools/json_schema_compiler/cpp_util_test.py |
+++ b/tools/json_schema_compiler/cpp_util_test.py |
@@ -13,5 +13,19 @@ class CppUtilTest(unittest.TestCase): |
cpp_util.Classname('updateAllTheThings')) |
self.assertEquals('Aa_Bb_Cc', cpp_util.Classname('aa.bb.cc')) |
+ def testNamespaceDeclaration(self): |
+ self.assertEquals('namespace extensions {', |
+ cpp_util.OpenNamespace('extensions').Render()) |
+ self.assertEquals('} // namespace extensions', |
+ cpp_util.CloseNamespace('extensions').Render()) |
+ self.assertEquals('namespace extensions {\n' |
+ 'namespace gen {\n' |
+ 'namespace api {', |
+ cpp_util.OpenNamespace('extensions::gen::api').Render()) |
+ self.assertEquals('} // namespace api\n' |
+ '} // namespace gen\n' |
+ '} // namespace extensions', |
+ cpp_util.CloseNamespace('extensions::gen::api').Render()) |
+ |
if __name__ == '__main__': |
unittest.main() |