diff options
author | Simon Warta <[email protected]> | 2017-10-19 10:24:30 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2017-10-19 10:45:57 +0200 |
commit | 4a5b134633a94f11a83afa7feeded90392315790 (patch) | |
tree | 96d97b58e98928f96735ae015da75901ad2fdcef /src/scripts/python_unittests.py | |
parent | 5b3696864396ab24c2da47106721cf25721a4468 (diff) |
Allow trailing comments for include matchers
Diffstat (limited to 'src/scripts/python_unittests.py')
-rwxr-xr-x | src/scripts/python_unittests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/scripts/python_unittests.py b/src/scripts/python_unittests.py index 37fa25721..337f5369e 100755 --- a/src/scripts/python_unittests.py +++ b/src/scripts/python_unittests.py @@ -21,6 +21,7 @@ from configure import ModulesChooser # pylint: disable=wrong-import-position class AmalgamationHelperTests(unittest.TestCase): def test_matcher_std_includes(self): self.assertEqual(AmalgamationHelper.is_unconditional_std_include("#include <string>"), "string") + self.assertEqual(AmalgamationHelper.is_unconditional_std_include("#include <string> // comment"), "string") self.assertEqual(AmalgamationHelper.is_unconditional_std_include("#include <myfile.h>"), None) self.assertEqual(AmalgamationHelper.is_unconditional_std_include("#include <unistd.h>"), None) @@ -31,6 +32,10 @@ class AmalgamationHelperTests(unittest.TestCase): "oids.h") self.assertEqual(AmalgamationHelper.is_botan_include("#include <botan/internal/socket.h>"), "internal/socket.h") + self.assertEqual(AmalgamationHelper.is_botan_include("#include <botan/oids.h> // comment"), + "oids.h") + self.assertEqual(AmalgamationHelper.is_botan_include("#include <botan/internal/socket.h> // comment"), + "internal/socket.h") self.assertEqual(AmalgamationHelper.is_botan_include(" #include <botan/oids.h>"), "oids.h") self.assertEqual(AmalgamationHelper.is_botan_include(" #include <botan/internal/socket.h>"), @@ -51,6 +56,11 @@ class AmalgamationHelperTests(unittest.TestCase): self.assertEqual(AmalgamationHelper.is_any_include(" #include <unistd.h>"), "unistd.h") self.assertEqual(AmalgamationHelper.is_any_include(" #include <botan/oids.h>"), "botan/oids.h") + self.assertEqual(AmalgamationHelper.is_any_include("#include <string> // comment"), "string") + self.assertEqual(AmalgamationHelper.is_any_include("#include <myfile.h> // comment"), "myfile.h") + self.assertEqual(AmalgamationHelper.is_any_include("#include <unistd.h> // comment"), "unistd.h") + self.assertEqual(AmalgamationHelper.is_any_include("#include <botan/oids.h> // comment"), + "botan/oids.h") class CompilerDetection(unittest.TestCase): |