diff --git a/tests/test_buildreq.py b/tests/test_buildreq.py index 8eb1bad..7b675b2 100644 --- a/tests/test_buildreq.py +++ b/tests/test_buildreq.py @@ -450,6 +450,20 @@ class TestBuildreq(unittest.TestCase): self.assertEqual(buildreq.buildreqs, set(['pkgconfig(gio-unix-2.0)', 'pkgconfig(glib-2.0)'])) + def test_parse_cmake_pkg_check_modules_whitespace(self): + """ + Test parse_cmake to ensure accurate handling of versioned + pkgconfig modules with whitespace. + """ + content = 'pkg_check_modules(GLIB gio-unix-2.0 >= 2.46.0 glib-2.0 REQUIRED)' + with tempfile.TemporaryDirectory() as tmpd: + with open(os.path.join(tmpd, 'fname'), 'w') as f: + f.write(content) + buildreq.parse_cmake(os.path.join(tmpd, 'fname')) + + self.assertEqual(buildreq.buildreqs, + set(['pkgconfig(gio-unix-2.0)', 'pkgconfig(glib-2.0)'])) + if __name__ == '__main__': unittest.main(buffer=True)