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

Side by Side Diff: tools/json_schema_compiler/code_test.py

Issue 12181005: generated_api.h should have its body generated into generated_api.cc (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest master Created 7 years, 10 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 from code import Code 6 from code import Code
7 import unittest 7 import unittest
8 8
9 class CodeTest(unittest.TestCase): 9 class CodeTest(unittest.TestCase):
10 def testAppend(self): 10 def testAppend(self):
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 c.Comment('20% of 80%s') 154 c.Comment('20% of 80%s')
155 c.Substitute({}) 155 c.Substitute({})
156 self.assertEquals('// 20% of 80%s', c.Render()) 156 self.assertEquals('// 20% of 80%s', c.Render())
157 d = Code() 157 d = Code()
158 d.Append('90') 158 d.Append('90')
159 d.Concat(c) 159 d.Concat(c)
160 self.assertEquals('90\n' 160 self.assertEquals('90\n'
161 '// 20% of 80%s', 161 '// 20% of 80%s',
162 d.Render()) 162 d.Render())
163 163
164 def testAdjustIndentLevel(self):
165 c = Code()
166 c.Sblock('sblock')
167 c.AdjustIndentLevel(-1)
168 c.Append('inner')
169 c.AdjustIndentLevel(1)
170 c.Append('moreinner')
171 c.Eblock('eblock')
172 self.assertEquals(
173 'sblock\n'
174 ' inner\n'
175 ' moreinner\n'
176 'eblock',
177 c.Render())
178
164 if __name__ == '__main__': 179 if __name__ == '__main__':
165 unittest.main() 180 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698