]> Sergey Matveev's repositories - zsh-autoenv.git/blob - tests/cwd.t
526ff63be845650845351c0b0c5ac1ffb521009e
[zsh-autoenv.git] / tests / cwd.t
1 Test $PWD and $_dotenv_cwd.
2
3   $ source $TESTDIR/setup.sh
4
5 Setup env actions / output.
6
7   $ DOTENV_LOOK_UPWARDS=1
8   $ mkdir -p sub/sub2
9   $ cd sub
10   $ echo 'echo ENTERED: cwd:${PWD:t} ${_dotenv_cwd:t}' >> .env
11   $ echo 'echo LEFT: cwd:${PWD:t} ${_dotenv_cwd:t}' >> .env.leave
12
13 Manually create auth files.
14
15   $ echo "$PWD/$DOTENV_FILE_ENTER:$(echo $(<$DOTENV_FILE_ENTER) | shasum)" > $ENV_AUTHORIZATION_FILE
16   $ echo "$PWD/$DOTENV_FILE_LEAVE:$(echo $(<$DOTENV_FILE_LEAVE) | shasum)" >> $ENV_AUTHORIZATION_FILE
17
18 The actual tests.
19
20   $ cd .
21   ENTERED: cwd:sub sub
22
23   $ cd ..
24   LEFT: cwd:sub cwd.t
25
26   $ cd sub/sub2
27   ENTERED: cwd:sub sub2