1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2024-11-14 05:00:58 +02:00
zsh-autoenv/tests/cwd.t

38 lines
844 B
Perl
Raw Normal View History

Test $PWD, $_autoenv_from_dir and _autoenv_to_dir.
$ source $TESTDIR/setup.sh
Setup env actions / output.
$ AUTOENV_LOOK_UPWARDS=1
$ mkdir -p sub/sub2
$ cd sub
$ echo 'echo ENTERED: PWD:${PWD:t} from:${_autoenv_from_dir:t} to:${_autoenv_to_dir:t}' > .env
$ echo 'echo LEFT: PWD:${PWD:t} from:${_autoenv_from_dir:t} to:${_autoenv_to_dir:t}' > .env.leave
Manually create auth files.
$ test_autoenv_auth_env_files
The actual tests.
$ cd .
2014-11-21 23:33:00 +02:00
ENTERED: PWD:sub from:sub to:sub
$ cd ..
2014-11-21 23:33:00 +02:00
LEFT: PWD:sub from:sub to:cwd.t
$ cd sub/sub2
ENTERED: PWD:sub from:cwd.t to:sub2
Check that symlinked dirs get handled correctly.
$ cd ../..
LEFT: PWD:sub from:sub2 to:cwd.t
$ ln -s sub sub_linked
$ cd sub_linked
ENTERED: PWD:sub from:cwd.t to:sub_linked
$ cd sub2
ENTERED: PWD:sub from:sub_linked to:sub2
$ cd .