annotate scripts/test/pwd.test @ 775:cf7bbafa06d1

Add some tests for pwd.
author Felix Janda <felix.janda@posteo.de>
date Fri, 28 Dec 2012 22:10:21 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
775
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
1 #!/bin/bash
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
2
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
3 [ -f testing.sh ] && . testing.sh
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
4
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
5 #testing "name" "command" "result" "infile" "stdin"
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
6
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
7 #TODO: Find better tests
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
8
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
9 testing "pwd" "[ $(stat -c %i "$(pwd)") = $(stat -c %i .) ] && echo yes" \
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
10 "yes\n" "" ""
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
11 testing "pwd -P" "[ $(stat -c %i "$(pwd -P)") = $(stat -c %i .) ] && echo yes" \
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
12 "yes\n" "" ""
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
13
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
14
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
15 ln -s . sym
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
16 cd sym
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
17 testing "pwd" "[ $(stat -c %i "$(pwd)") = $(stat -c %i "$PWD") ] && echo yes" \
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
18 "yes\n" "" ""
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
19 testing "pwd -P" "[ $(stat -c %i "$(pwd -P)") = $(stat -c %i "$PWD") ] || echo yes" \
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
20 "yes\n" "" ""
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
21 cd ..
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
22 rm sym
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
23
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
24 export PWD=walrus
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
25 testing "pwd (bad PWD)" "[ "$(pwd)" = "$(cd . ; pwd)" ] && echo yes" \
cf7bbafa06d1 Add some tests for pwd.
Felix Janda <felix.janda@posteo.de>
parents:
diff changeset
26 "yes\n" "" ""