tests: Add a rewriter test that handles prefix
"prefix" has a lot of special handling that has to go on because so many other options depend on prefix. It was also regressed by the option refactor changes, so having a test feels appropriate. This was verified against the 1.7 release, so it has the same behavior as pre-option refactor Meson.
This commit is contained in:
parent
768712cf32
commit
9d1837e1af
|
@ -0,0 +1,5 @@
|
|||
project('lalala', 'cpp',
|
||||
default_options : [
|
||||
'prefix=/export/doocs',
|
||||
],
|
||||
)
|
|
@ -407,3 +407,18 @@ class RewriterTests(BasePlatformTests):
|
|||
# Do it line per line because it is easier to debug like that
|
||||
for orig_line, new_line in zip_longest(original_contents.splitlines(), new_contents.splitlines()):
|
||||
self.assertEqual(orig_line, new_line)
|
||||
|
||||
@unittest.expectedFailure
|
||||
def test_rewrite_prefix(self) -> None:
|
||||
self.prime('7 prefix')
|
||||
out = self.rewrite_raw(self.builddir, ['kwargs', 'info', 'project', '/'])
|
||||
expected = {
|
||||
'kwargs': {
|
||||
'project#/': {
|
||||
"default_options": [
|
||||
'prefix=/export/doocs'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
self.assertDictEqual(out, expected)
|
||||
|
|
Loading…
Reference in New Issue