mirror of
https://github.com/clearlinux/autospec.git
synced 2026-08-26 18:35:57 +00:00
Add unit test for pkg_check_modules with whitespace
This commit is contained in:
committed by
William Douglas
parent
8ab07d0e0d
commit
30a2528f95
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user