From 5beac8246773bb1eea59e65b7f19308617d82321 Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Fri, 3 Apr 2026 10:41:25 +0000 Subject: [PATCH] test(interpreter): add regression tests for bash -c exported variable visibility Closes #943 --- .../spec_cases/bash/bash-c-exports.test.sh | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 crates/bashkit/tests/spec_cases/bash/bash-c-exports.test.sh diff --git a/crates/bashkit/tests/spec_cases/bash/bash-c-exports.test.sh b/crates/bashkit/tests/spec_cases/bash/bash-c-exports.test.sh new file mode 100644 index 00000000..6bef9e01 --- /dev/null +++ b/crates/bashkit/tests/spec_cases/bash/bash-c-exports.test.sh @@ -0,0 +1,23 @@ +### bash_c_sees_exported_vars +# bash -c should inherit exported variables +export TEST_EXPORT_VAR="visible" +bash -c 'echo "$TEST_EXPORT_VAR"' +### expect +visible +### end + +### bash_c_assigns_from_export +# bash -c can assign from exported vars +export TEST_ASSIGN_VAR="value" +bash -c 'x=$TEST_ASSIGN_VAR; echo "x=$x"' +### expect +x=value +### end + +### bash_c_multiple_exports +# bash -c sees multiple exports +export A1=one A2=two +bash -c 'echo "$A1 $A2"' +### expect +one two +### end