1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2024-06-28 19:00:10 +03:00
zsh-autoenv/tests/cwd.t

28 lines
631 B
Perl

Test $PWD and $_dotenv_cwd.
$ source $TESTDIR/setup.sh
Setup env actions / output.
$ DOTENV_LOOK_UPWARDS=1
$ mkdir -p sub/sub2
$ cd sub
$ echo 'echo ENTERED: cwd:${PWD:t} ${_dotenv_cwd:t}' >> .env
$ echo 'echo LEFT: cwd:${PWD:t} ${_dotenv_cwd:t}' >> .env.leave
Manually create auth files.
$ echo "$PWD/$DOTENV_FILE_ENTER:$(echo $(<$DOTENV_FILE_ENTER) | shasum)" > $AUTOENV_ENV_FILENAME
$ echo "$PWD/$DOTENV_FILE_LEAVE:$(echo $(<$DOTENV_FILE_LEAVE) | shasum)" >> $AUTOENV_ENV_FILENAME
The actual tests.
$ cd .
ENTERED: cwd:sub sub
$ cd ..
LEFT: cwd:sub cwd.t
$ cd sub/sub2
ENTERED: cwd:sub sub2