Mercurial > hg > toybox
view scripts/test/pwd.test @ 994:00c7b6f4104a
Cleanup klogd
Remove #if and inline most functions
author | Felix Janda <felix.janda@posteo.de> |
---|---|
date | Sat, 10 Aug 2013 19:35:11 +0200 |
parents | cf7bbafa06d1 |
children |
line wrap: on
line source
#!/bin/bash [ -f testing.sh ] && . testing.sh #testing "name" "command" "result" "infile" "stdin" #TODO: Find better tests testing "pwd" "[ $(stat -c %i "$(pwd)") = $(stat -c %i .) ] && echo yes" \ "yes\n" "" "" testing "pwd -P" "[ $(stat -c %i "$(pwd -P)") = $(stat -c %i .) ] && echo yes" \ "yes\n" "" "" ln -s . sym cd sym testing "pwd" "[ $(stat -c %i "$(pwd)") = $(stat -c %i "$PWD") ] && echo yes" \ "yes\n" "" "" testing "pwd -P" "[ $(stat -c %i "$(pwd -P)") = $(stat -c %i "$PWD") ] || echo yes" \ "yes\n" "" "" cd .. rm sym export PWD=walrus testing "pwd (bad PWD)" "[ "$(pwd)" = "$(cd . ; pwd)" ] && echo yes" \ "yes\n" "" ""