diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-11-19 14:59:01 +0100 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-11-19 09:13:05 -0800 |
| commit | 665bf31e0b1c8905f107cb085e179dd8d8b82302 (patch) | |
| tree | 172d3ec14684fa6960507e0dd6533ffe22c94f0d /unittests | |
| parent | c6341fcd56a704973b24626def6111d1a6547542 (diff) | |
| download | meson-665bf31e0b1c8905f107cb085e179dd8d8b82302.tar.gz | |
options: the parent of a yielding option can be falsy
Fixes: #15258
Diffstat (limited to 'unittests')
| -rw-r--r-- | unittests/optiontests.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/unittests/optiontests.py b/unittests/optiontests.py index 428b82ebb..a3a2f54e9 100644 --- a/unittests/optiontests.py +++ b/unittests/optiontests.py @@ -482,3 +482,16 @@ class OptionTests(unittest.TestCase): stored_value = optstore.get_value_for(key) self.assertIsInstance(stored_value, bool) self.assertTrue(stored_value) + + def test_yielding_boolean_option_with_falsy_parent(self): + """Test that yielding is correctly initialized when parent option value is False.""" + optstore = OptionStore(False) + name = 'someoption' + subproject_name = 'sub' + parent_option = UserBooleanOption(name, 'A parent boolean option', False, yielding=True) + optstore.add_project_option(OptionKey(name, ''), parent_option) + + child_option = UserBooleanOption(name, 'A child boolean option', True, yielding=True) + child_key = OptionKey(name, subproject_name) + optstore.add_project_option(child_key, child_option) + self.assertTrue(optstore.options[child_key].yielding) |
