1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2024-07-08 23:30:11 +03:00
zsh-autoenv/tests/varstash-unstash-on-leave.t

26 lines
507 B
Perl
Raw Normal View History

Test unstash behavior on leaving.
$ source $TESTDIR/setup.zsh || return 1
Setup test environment.
$ mkdir sub
$ echo 'echo ENTER; stash FOO=changed' >| sub/$AUTOENV_FILE_ENTER
$ echo 'echo LEAVE; unstash FOO' >| sub/$AUTOENV_FILE_LEAVE
$ test_autoenv_auth_env_files sub
$ FOO=orig
Activating the env stashes it and applies a new value.
$ cd sub
ENTER
$ echo $FOO
changed
Leaving the directory unstashes it (varstash_dir is set to prev dir).
$ cd ..
LEAVE
$ echo $FOO
orig