1 Tests for internal stack handling.
3 $ source $TESTDIR/setup.zsh || return 1
5 Non-existing entries are allowed and handled without error.
7 $ _autoenv_stack_entered_add non-existing
8 $ echo $_autoenv_stack_entered
14 $ touch -t 201401010101 sub/file
15 $ touch -t 201401010102 sub
16 $ touch -t 201401010103 sub/sub2
17 $ _autoenv_stack_entered_add sub
18 $ _autoenv_stack_entered_add sub/file
19 $ _autoenv_stack_entered_add sub/sub2
20 $ echo $_autoenv_stack_entered
21 non-existing sub sub/file sub/sub2
23 $ _autoenv_stack_entered_add non-existing
24 $ echo $_autoenv_stack_entered
25 sub sub/file sub/sub2 non-existing
27 $ echo ${(k)_autoenv_stack_entered}
28 sub sub/file sub/sub2 non-existing
30 $ echo $_autoenv_stack_entered_mtime
31 1388538180 1388538060 1388538120 0
33 Touch the file and re-add it.
35 $ touch -t 201401012359 sub/file
36 $ _autoenv_stack_entered_add sub/file
38 The mtime should have been updated.
40 $ echo ${_autoenv_stack_entered_mtime[sub/file]}
43 It should have moved to the end of the stack.
45 $ echo ${(k)_autoenv_stack_entered}
46 sub sub/sub2 non-existing sub/file
48 Test lookup of containing elements.
50 $ _autoenv_stack_entered_contains sub/file
51 $ _autoenv_stack_entered_contains non-existing
52 $ _autoenv_stack_entered_contains not-added
57 $ _autoenv_stack_entered_remove sub
58 $ echo ${_autoenv_stack_entered}
59 sub/sub2 non-existing sub/file