1 Test varstash with exported variables in subshell.
3 $ source $TESTDIR/setup.zsh || return 1
5 Setup test environment.
9 $ echo 'echo ENTER; autostash MYVAR=changed; autostash MYEXPORT=changed_export' > $AUTOENV_FILE_ENTER
10 $ echo 'echo LEAVE; autounstash' > $AUTOENV_FILE_LEAVE
12 Manually create auth file
14 $ test_autoenv_auth_env_files
16 Set environment variable.
19 $ export MYEXPORT=orig_export
21 Activating the env stashes it and applies a new value.
30 The variable is not available in a subshell, only the exported one.
32 $ $SHELL -c 'echo ${MYVAR:-empty}; echo $MYEXPORT'
36 Activate autoenv in the subshell.
38 $ $SHELL -c "$TEST_SOURCE_AUTOENV; echo \${MYVAR}; echo \$MYEXPORT"
43 "autounstash" should handle the exported variables.
45 $ $SHELL -c "$TEST_SOURCE_AUTOENV; cd ..; echo \${MYVAR:-empty}; echo \$MYEXPORT"