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

Side by Side Diff: client/dom/scripts/dartgenerator_test.py

Issue 9403004: Wrapperless dart:html generator (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Final version to check in. changes generator script but doesn't check in an active version of the … Created 8 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 | Annotate | Revision Log
« no previous file with comments | « client/dom/scripts/dartgenerator.py ('k') | client/dom/scripts/database.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """Tests for dartgenerator.""" 6 """Tests for dartgenerator."""
7 7
8 import logging.config 8 import logging.config
9 import os.path 9 import os.path
10 import re 10 import re
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 boolean op(); 172 boolean op();
173 } 173 }
174 """) 174 """)
175 175
176 self._AssertOutputContains('Rectangle', 176 self._AssertOutputContains('Rectangle',
177 'interface Rectangle extends shapes::Shape') 177 'interface Rectangle extends shapes::Shape')
178 178
179 def testTypeRenames(self): 179 def testTypeRenames(self):
180 self._database.Load() 180 self._database.Load()
181 # Translate 'Shape' to spanish: 181 # Translate 'Shape' to spanish:
182 self._generator.RenameTypes(self._database, {'Shape': 'Forma'}) 182 self._generator.RenameTypes(self._database, {'Shape': 'Forma'}, False)
183 self._generator.Generate(self._database, self._output_dir) 183 self._generator.Generate(self._database, self._output_dir)
184 self._generator.Flush() 184 self._generator.Flush()
185 185
186 # Validate that all references to Shape have been converted: 186 # Validate that all references to Shape have been converted:
187 self._AssertOutputContains('Forma', 187 self._AssertOutputContains('Forma',
188 'interface Forma') 188 'interface Forma')
189 self._AssertOutputContains('Forma', 'Forma create();') 189 self._AssertOutputContains('Forma', 'Forma create();')
190 self._AssertOutputContains('Forma', 190 self._AssertOutputContains('Forma',
191 'boolean compare(Forma s);') 191 'boolean compare(Forma s);')
192 self._AssertOutputContains('Rectangle', 192 self._AssertOutputContains('Rectangle',
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 # Verify template conversion: 228 # Verify template conversion:
229 # TODO(vsm): Re-enable when core collections are supported. 229 # TODO(vsm): Re-enable when core collections are supported.
230 # self._AssertOutputContains('rectangles', 'Rectangle', 230 # self._AssertOutputContains('rectangles', 'Rectangle',
231 # 'void someTemplatedType(List<Shape> list)') 231 # 'void someTemplatedType(List<Shape> list)')
232 232
233 233
234 if __name__ == '__main__': 234 if __name__ == '__main__':
235 logging.config.fileConfig('logging.conf') 235 logging.config.fileConfig('logging.conf')
236 if __name__ == '__main__': 236 if __name__ == '__main__':
237 unittest.main() 237 unittest.main()
OLDNEW
« no previous file with comments | « client/dom/scripts/dartgenerator.py ('k') | client/dom/scripts/database.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698