mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
tests(export): ensure previous value of variable works correctly
This commit is contained in:
parent
29187f08da
commit
a040ad5613
1 changed files with 27 additions and 0 deletions
27
test.sh
27
test.sh
|
|
@ -1139,4 +1139,31 @@ expecting <<"EOF"
|
||||||
- hello' 'world -
|
- hello' 'world -
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
when_run <<"EOF" "previous variable value in export"
|
||||||
|
export VAR=hello
|
||||||
|
export VAR=" $VAR and goodbye"
|
||||||
|
echo $VAR | cat -e
|
||||||
|
EOF
|
||||||
|
expecting <<EOF
|
||||||
|
hello and goodbye$
|
||||||
|
EOF
|
||||||
|
|
||||||
|
when_run <<"EOF" "previous variable value in export, but single-quoted"
|
||||||
|
export VAR=hello
|
||||||
|
export VAR=' $VAR and goodbye'
|
||||||
|
echo $VAR | cat -e
|
||||||
|
EOF
|
||||||
|
expecting <<"EOF"
|
||||||
|
$VAR and goodbye$
|
||||||
|
EOF
|
||||||
|
|
||||||
|
when_run <<"EOF" "previous variable value in export, with word joining"
|
||||||
|
export VAR=hello
|
||||||
|
export VAR=" $VAR and goodbye"$VAR
|
||||||
|
echo $VAR | cat -e
|
||||||
|
EOF
|
||||||
|
expecting <<EOF
|
||||||
|
hello and goodbyehello$
|
||||||
|
EOF
|
||||||
|
|
||||||
finalize
|
finalize
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue