~sircmpwn/ctools

ref: 10cfd2d3578789369ec35ab6635121f943635742 ctools/test/pwd -rw-r--r-- 392 bytes View raw
10cfd2d3Pedro L. Ramos Implemented pwd 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
tool="pwd"
. "$HARNESS"

mkdir "$TMPDIR"/dir-f
ln -s "$TMPDIR"/dir-f "$TMPDIR"/dir-s

should_work() (
    cd "$TMPDIR/dir-f"
    ct="$(pwd)"
    [ "$ct" = "$TMPDIR/dir-f" ]
)

should_handle_symlink() (
    cd "$TMPDIR/dir-f"
    ct="$(pwd -L)"
    [ "$ct" = "$TMPDIR/dir-f" ]
)

should_resolve_symlink() (
    cd "$TMPDIR/dir-f"
    ct="$(pwd -P)"
    [ "$ct" = "$TMPDIR/dir-f" ]
)