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

Unified Diff: tools/json_schema_compiler/code_test.py

Issue 1010603007: [Extension API Extern Generation] Fix comment indentation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: True 80 char limit Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/json_schema_compiler/code.py ('k') | tools/json_schema_compiler/js_externs_generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/code_test.py
diff --git a/tools/json_schema_compiler/code_test.py b/tools/json_schema_compiler/code_test.py
index ca3652420f9018e391e2eca1f1b0f0ec9f6f13b4..c6ca33f5b688242fd6419896387770c701fb0a02 100755
--- a/tools/json_schema_compiler/code_test.py
+++ b/tools/json_schema_compiler/code_test.py
@@ -117,14 +117,14 @@ class CodeTest(unittest.TestCase):
self.assertFalse(c.IsEmpty())
def testComment(self):
- long_comment = ('This comment is eighty nine characters in longness, '
- 'that is, to use another word, length')
+ long_comment = ('This comment is ninety one characters in longness, '
+ 'that is, using a different word, length.')
c = Code()
c.Comment(long_comment)
self.assertEquals(
- '// This comment is eighty nine characters '
- 'in longness, that is, to use another\n'
- '// word, length',
+ '// This comment is ninety one characters '
+ 'in longness, that is, using a different\n'
+ '// word, length.',
c.Render())
c = Code()
c.Sblock('sblock')
@@ -133,13 +133,13 @@ class CodeTest(unittest.TestCase):
c.Comment(long_comment)
self.assertEquals(
'sblock\n'
- ' // This comment is eighty nine characters '
- 'in longness, that is, to use\n'
- ' // another word, length\n'
+ ' // This comment is ninety one characters '
+ 'in longness, that is, using a\n'
+ ' // different word, length.\n'
'eblock\n'
- '// This comment is eighty nine characters in '
- 'longness, that is, to use another\n'
- '// word, length',
+ '// This comment is ninety one characters in '
+ 'longness, that is, using a different\n'
+ '// word, length.',
c.Render())
long_word = 'x' * 100
c = Code()
@@ -148,6 +148,14 @@ class CodeTest(unittest.TestCase):
'// ' + 'x' * 77 + '\n'
'// ' + 'x' * 23,
c.Render())
+ c = Code(indent_size=2, comment_length=40)
+ c.Comment('Pretend this is a Closure Compiler style comment, which should '
+ 'both wrap and indent', comment_prefix=' * ', wrap_indent=4)
+ self.assertEquals(
+ ' * Pretend this is a Closure Compiler\n'
+ ' * style comment, which should both\n'
+ ' * wrap and indent',
+ c.Render())
def testCommentWithSpecialCharacters(self):
c = Code()
« no previous file with comments | « tools/json_schema_compiler/code.py ('k') | tools/json_schema_compiler/js_externs_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698