diff options
author | rdevlin.cronin <rdevlin.cronin@chromium.org> | 2015-04-07 10:20:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-07 17:21:35 +0000 |
commit | 68411116575f7afcaf5491ed893019da12b649ae (patch) | |
tree | c9859ca7b5c45aea8e00bbd658e43c91a8dae45d /tools/json_schema_compiler/code_test.py | |
parent | 155d7e5b71ca9b4e6ea5b86d5edfc503862f1a60 (diff) | |
download | chromium_src-68411116575f7afcaf5491ed893019da12b649ae.zip chromium_src-68411116575f7afcaf5491ed893019da12b649ae.tar.gz chromium_src-68411116575f7afcaf5491ed893019da12b649ae.tar.bz2 |
[Extension API Extern Generation] Fix a few bugs in extern generation
Properly handle the case of an "object" (one deliberately left undefined in the
idl/json), and fix an off-by-one error in the comment wrapping.
Add tests for each.
BUG=469920
Review URL: https://codereview.chromium.org/1062573004
Cr-Commit-Position: refs/heads/master@{#324063}
Diffstat (limited to 'tools/json_schema_compiler/code_test.py')
-rwxr-xr-x | tools/json_schema_compiler/code_test.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/json_schema_compiler/code_test.py b/tools/json_schema_compiler/code_test.py index 7d64b6c..90e2879 100755 --- a/tools/json_schema_compiler/code_test.py +++ b/tools/json_schema_compiler/code_test.py @@ -191,7 +191,7 @@ class CodeTest(unittest.TestCase): ' */', output) - def testSameLineAppendAndConcat(self): + def testSameLineAppendConcatComment(self): c = Code() c.Append('This is a line.') c.Append('This too.', new_line=False) @@ -199,6 +199,15 @@ class CodeTest(unittest.TestCase): d.Append('And this.') c.Concat(d, new_line=False) self.assertEquals('This is a line.This too.And this.', c.Render()) + c = Code() + c.Append('This is a') + c.Comment(' spectacular 80-character line thingy ' + + 'that fits wonderfully everywhere.', + comment_prefix='', + new_line=False) + self.assertEquals('This is a spectacular 80-character line thingy that ' + + 'fits wonderfully everywhere.', + c.Render()) if __name__ == '__main__': unittest.main() |