]> Sergey Matveev's repositories - zsh-autoenv.git/blob - tests/varstash-alias.t
87a765f9346e379a7eefe4595808eeaecaaf0f62
[zsh-autoenv.git] / tests / varstash-alias.t
1 Test varstash integration with regard to aliases.
2
3   $ source $TESTDIR/setup.zsh || return 1
4
5 Setup test environment.
6
7   $ mkdir sub
8   $ cd sub
9   $ echo 'echo ENTER' > $AUTOENV_FILE_ENTER
10   $ echo 'autostash alias some_alias="echo NEW_ALIAS"' >> $AUTOENV_FILE_ENTER
11   $ echo 'echo LEAVE' > $AUTOENV_FILE_LEAVE
12   $ test_autoenv_auth_env_files
13
14 Aliases should be stashed.
15
16   $ alias some_alias="echo ORIG_ALIAS"
17   $ some_alias
18   ORIG_ALIAS
19   $ cd .
20   ENTER
21   $ some_alias
22   NEW_ALIAS
23   $ cd ..
24   LEAVE
25   $ some_alias
26   ORIG_ALIAS
27
28 Aliases should be stashed, if there are also environment variables.
29
30   $ some_alias=ENV_VAR
31   $ some_alias
32   ORIG_ALIAS
33   $ cd sub
34   ENTER
35   $ type -w some_alias
36   some_alias: alias
37   $ echo $some_alias
38   ENV_VAR