diff --git a/unit_test/options_test.py b/unit_test/options_test.py index 134db012..009900df 100644 --- a/unit_test/options_test.py +++ b/unit_test/options_test.py @@ -253,3 +253,22 @@ def test_container_engine_option(tmp_path: Path, toml_assignment, result_name, r assert parsed_container_engine.name == result_name assert parsed_container_engine.create_args == result_create_args + + +def test_environment_pass_references(): + options = Options( + platform="linux", + command_line_arguments=CommandLineArguments.defaults(), + env={ + "CIBW_ENVIRONMENT_PASS_LINUX": "STARTER MAIN_COURSE", + "STARTER": "green eggs", + "MAIN_COURSE": "ham", + "CIBW_ENVIRONMENT": 'MEAL="$STARTER and $MAIN_COURSE"', + }, + ) + parsed_environment = options.build_options(identifier=None).environment + assert parsed_environment.as_dictionary(prev_environment={}) == { + "MEAL": "green eggs and ham", + "STARTER": "green eggs", + "MAIN_COURSE": "ham", + }