diff options
Diffstat (limited to 'tests/format')
5 files changed, 31 insertions, 0 deletions
diff --git a/tests/format/options.py b/tests/format/options.py index b537fdfbf..2076106cb 100644 --- a/tests/format/options.py +++ b/tests/format/options.py @@ -25,6 +25,17 @@ def test_invalid_option_name(cli, datafiles, project_dir): @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.parametrize("project_dir", [ + ('invalid-variable-name-spaces'), + ('invalid-variable-name-plus'), +]) +def test_invalid_variable_name(cli, datafiles, project_dir): + project = os.path.join(datafiles.dirname, datafiles.basename, project_dir) + result = cli.run(project=project, silent=True, args=['show', 'element.bst']) + result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_SYMBOL_NAME) + + +@pytest.mark.datafiles(DATA_DIR) def test_invalid_option_type(cli, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename, 'invalid-type') diff --git a/tests/format/options/invalid-variable-name-plus/element.bst b/tests/format/options/invalid-variable-name-plus/element.bst new file mode 100644 index 000000000..e006c8a96 --- /dev/null +++ b/tests/format/options/invalid-variable-name-plus/element.bst @@ -0,0 +1,2 @@ +kind: autotools + diff --git a/tests/format/options/invalid-variable-name-plus/project.conf b/tests/format/options/invalid-variable-name-plus/project.conf new file mode 100644 index 000000000..5652bb8b3 --- /dev/null +++ b/tests/format/options/invalid-variable-name-plus/project.conf @@ -0,0 +1,8 @@ +name: test + +options: + pony: + type: bool + description: Whether a pony + default: False + variable: pony+ diff --git a/tests/format/options/invalid-variable-name-spaces/element.bst b/tests/format/options/invalid-variable-name-spaces/element.bst new file mode 100644 index 000000000..e006c8a96 --- /dev/null +++ b/tests/format/options/invalid-variable-name-spaces/element.bst @@ -0,0 +1,2 @@ +kind: autotools + diff --git a/tests/format/options/invalid-variable-name-spaces/project.conf b/tests/format/options/invalid-variable-name-spaces/project.conf new file mode 100644 index 000000000..5115115bf --- /dev/null +++ b/tests/format/options/invalid-variable-name-spaces/project.conf @@ -0,0 +1,8 @@ +name: test + +options: + pony: + type: bool + description: Whether a pony + default: False + variable: the variable |