OLD | NEW |
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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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', |
193 'interface Rectangle extends Forma') | 193 'interface Rectangle extends Forma') |
194 | 194 |
195 def testQualifiedDartTypes(self): | 195 def testQualifiedDartTypes(self): |
196 self._database.Load() | 196 self._database.Load() |
197 self._generator.FilterMembersWithUnidentifiedTypes(self._database) | 197 self._generator.FilterMembersWithUnidentifiedTypes(self._database) |
198 self._generator.ConvertToDartTypes(self._database) | |
199 self._generator.Generate(self._database, self._output_dir) | 198 self._generator.Generate(self._database, self._output_dir) |
200 self._generator.Flush() | 199 self._generator.Flush() |
201 | 200 |
202 # Verify primitive conversions are working: | 201 # Verify primitive conversions are working: |
203 self._AssertOutputContains('Shape', | 202 self._AssertOutputContains('Shape', |
204 'static final int CONSTANT = 1') | 203 'static final int CONSTANT = 1') |
205 self._AssertOutputContains('Shape', | 204 self._AssertOutputContains('Shape', |
206 'final String strAttr;') | 205 'final String strAttr;') |
207 | 206 |
208 # Verify interface names are converted: | 207 # Verify interface names are converted: |
(...skipping 19 matching lines...) Expand all Loading... |
228 # Verify template conversion: | 227 # Verify template conversion: |
229 # TODO(vsm): Re-enable when core collections are supported. | 228 # TODO(vsm): Re-enable when core collections are supported. |
230 # self._AssertOutputContains('rectangles', 'Rectangle', | 229 # self._AssertOutputContains('rectangles', 'Rectangle', |
231 # 'void someTemplatedType(List<Shape> list)') | 230 # 'void someTemplatedType(List<Shape> list)') |
232 | 231 |
233 | 232 |
234 if __name__ == '__main__': | 233 if __name__ == '__main__': |
235 logging.config.fileConfig('logging.conf') | 234 logging.config.fileConfig('logging.conf') |
236 if __name__ == '__main__': | 235 if __name__ == '__main__': |
237 unittest.main() | 236 unittest.main() |
OLD | NEW |