diff options
Diffstat (limited to 'tests/format/include.py')
-rw-r--r-- | tests/format/include.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/format/include.py b/tests/format/include.py index d57dd8c19..11659d459 100644 --- a/tests/format/include.py +++ b/tests/format/include.py @@ -219,6 +219,30 @@ def test_conditional_in_fragment(cli, datafiles): assert loaded.get_str("size") == "8" +@pytest.mark.parametrize( + "project_dir", + [ + "conditional-conflicts-project", + "conditional-conflicts-element", + "conditional-conflicts-options-included", + "conditional-conflicts-complex", + "conditional-conflicts-toplevel-precedence", + ], +) +@pytest.mark.datafiles(DATA_DIR) +def test_preserve_conditionals(cli, datafiles, project_dir): + project = os.path.join(str(datafiles), project_dir) + + result = cli.run( + project=project, + args=["-o", "build_arch", "i586", "show", "--deps", "none", "--format", "%{vars}", "element.bst"], + ) + result.assert_success() + loaded = _yaml.load_data(result.output) + assert loaded.get_str("enable-work-around") == "true" + assert loaded.get_str("size") == "4" + + @pytest.mark.datafiles(DATA_DIR) def test_inner(cli, datafiles): project = os.path.join(str(datafiles), "inner") |