diff --git a/unit_test/environment_test.py b/unit_test/environment_test.py index 4e10e07c..5a0cf613 100644 --- a/unit_test/environment_test.py +++ b/unit_test/environment_test.py @@ -103,3 +103,14 @@ def test_operators_inside_eval(): environment_dict = environment_recipe.as_dictionary(os.environ.copy()) assert environment_dict.get('SOMETHING') == 'a\nb\nc' + + +def test_substitution_with_backslash(): + environment_recipe = parse_environment('PATH2="somewhere_else;$PATH1"') + + # pass the existing process env so PATH is available + environment_dict = environment_recipe.as_dictionary(prev_environment={ + 'PATH1': 'c:\\folder\\' + }) + + assert environment_dict.get('PATH2') == 'somewhere_else;c:\\folder\\'