1 Test varstash integration.
3 $ source $TESTDIR/setup.zsh || return 1
5 Setup test environment.
10 The varstash library should not get loaded always.
12 $ echo 'echo ENTER' > $AUTOENV_FILE_ENTER
13 $ echo 'echo LEAVE' > $AUTOENV_FILE_LEAVE
14 $ test_autoenv_auth_env_files
21 Now on to some stashing.
23 $ echo 'echo ENTER; autostash FOO=changed' >| $AUTOENV_FILE_ENTER
24 $ echo 'echo LEAVE; autounstash' >| $AUTOENV_FILE_LEAVE
25 $ test_autoenv_auth_env_files
27 Set environment variable.
31 Activating the env stashes it and applies a new value.
42 Leaving the directory unstashes it.
50 Test autounstashing when leaving a directory. {{{
57 $ echo 'echo ENTER; autostash VAR=changed' >| $AUTOENV_FILE_ENTER
58 $ echo 'echo LEAVE; echo "no explicit call to autounstash"' >| $AUTOENV_FILE_LEAVE
59 $ test_autoenv_auth_env_files
66 Trigger the autostashing in the enter file.
70 no explicit call to autounstash
80 no explicit call to autounstash
84 Remove the leave file, auto-unstashing should still happen.
86 $ rm sub/$AUTOENV_FILE_LEAVE
95 And once again where a value gets restored.