summaryrefslogtreecommitdiffstats
path: root/tools/json_schema_compiler/code_test.py
diff options
context:
space:
mode:
authorcalamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-02 15:05:27 +0000
committercalamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-02 15:05:27 +0000
commitfeba21e3dd6f25b0927817bdad749e47490e2798 (patch)
treeda16581c8c1658b385d6230423cc726df04cf4b7 /tools/json_schema_compiler/code_test.py
parent7ae87817552c6e8608f62304354fd88cb921a31c (diff)
downloadchromium_src-feba21e3dd6f25b0927817bdad749e47490e2798.zip
chromium_src-feba21e3dd6f25b0927817bdad749e47490e2798.tar.gz
chromium_src-feba21e3dd6f25b0927817bdad749e47490e2798.tar.bz2
json_schema_compiler: any, additionalProperties, functions on types
Add support and tests for more json types. Also fixed a number of API jsons. BUG= TEST= Review URL: http://codereview.chromium.org/9491002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124643 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/json_schema_compiler/code_test.py')
-rw-r--r--tools/json_schema_compiler/code_test.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/json_schema_compiler/code_test.py b/tools/json_schema_compiler/code_test.py
index 8431d95..a089f7fb 100644
--- a/tools/json_schema_compiler/code_test.py
+++ b/tools/json_schema_compiler/code_test.py
@@ -148,5 +148,17 @@ class CodeTest(unittest.TestCase):
'// ' + 'x' * 23,
c.Render())
+ def testCommentWithSpecialCharacters(self):
+ c = Code()
+ c.Comment('20% of 80%s')
+ c.Substitute({})
+ self.assertEquals('// 20% of 80%s', c.Render())
+ d = Code()
+ d.Append('90')
+ d.Concat(c)
+ self.assertEquals('90\n'
+ '// 20% of 80%s',
+ d.Render())
+
if __name__ == '__main__':
unittest.main()