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.
110 autostash does not issue a warning, and no other output. {{{
112 $ autostash something=1 something_else=2
113 $ echo $something $something_else
115 $ stash something=1.2 something_else=2.2
116 $ echo $something $something_else
118 $ stash something something_else
119 You have already stashed something, please specify "-f" if you want to overwrite another stashed value.
120 You have already stashed something_else, please specify "-f" if you want to overwrite another stashed value.
122 Should not be set anymore.
125 $ echo ${+something} ${+something_else}