| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2017 The Chromium Authors. All rights reserved. | 2 # Copyright 2017 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 import logging | 6 import logging |
| 7 import sys |
| 7 import unittest | 8 import unittest |
| 8 | 9 |
| 9 import function_signature | 10 import function_signature |
| 10 | 11 |
| 11 | 12 |
| 12 class AnalyzeTest(unittest.TestCase): | 13 class AnalyzeTest(unittest.TestCase): |
| 13 | 14 |
| 14 def testParseFunctionSignature(self): | 15 def testParseFunctionSignature(self): |
| 15 def check(ret_part, name_part, params_part, after_part=''): | 16 def check(ret_part, name_part, params_part, after_part=''): |
| 16 signature = ''.join((name_part, params_part, after_part)) | 17 signature = ''.join((name_part, params_part, after_part)) |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 SIG = '(anonymous namespace)::Foo::Baz() const::GLSLFP::onData(Foo, Bar)' | 81 SIG = '(anonymous namespace)::Foo::Baz() const::GLSLFP::onData(Foo, Bar)' |
| 81 got_full, got_name = function_signature.Parse(SIG) | 82 got_full, got_name = function_signature.Parse(SIG) |
| 82 self.assertEqual('(anonymous namespace)::Foo::Baz', got_name) | 83 self.assertEqual('(anonymous namespace)::Foo::Baz', got_name) |
| 83 self.assertEqual(SIG, got_full) | 84 self.assertEqual(SIG, got_full) |
| 84 | 85 |
| 85 | 86 |
| 86 if __name__ == '__main__': | 87 if __name__ == '__main__': |
| 87 logging.basicConfig(level=logging.DEBUG, | 88 logging.basicConfig(level=logging.DEBUG, |
| 88 format='%(levelname).1s %(relativeCreated)6d %(message)s') | 89 format='%(levelname).1s %(relativeCreated)6d %(message)s') |
| 89 unittest.main() | 90 unittest.main() |
| OLD | NEW |