Changeset View
Changeset View
Standalone View
Standalone View
bin/pwd/tests/pwd_test.sh
| Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | physical_body() | ||||
| export PWD="$root/baz" | export PWD="$root/baz" | ||||
| atf_check -o inline:"$root/phy/baz\n" pwd -L | atf_check -o inline:"$root/phy/baz\n" pwd -L | ||||
| # request logical but $PWD does not match | # request logical but $PWD does not match | ||||
| export PWD="$root/log" | export PWD="$root/log" | ||||
| atf_check -o inline:"$root/phy/baz\n" pwd -L | atf_check -o inline:"$root/phy/baz\n" pwd -L | ||||
| } | } | ||||
| atf_test_case stdout | |||||
| stdout_head() | |||||
| { | |||||
| atf_set descr "error writing to stdout" | |||||
| } | |||||
| stdout_body() | |||||
| { | |||||
| pwd=$(which pwd) | |||||
| [ -f "$pwd" ] || atf_skip "unable to distinguish binary from builtin" | |||||
| ( | |||||
| trap "" PIPE | |||||
| # Give true(1) some time to exit. | |||||
| sleep 1 | |||||
| $pwd 2>stderr | |||||
| echo $? >result | |||||
| ) | true | |||||
| atf_check -o inline:"1\n" cat result | |||||
| atf_check -o match:"stdout" cat stderr | |||||
| } | |||||
| atf_init_test_cases() | atf_init_test_cases() | ||||
| { | { | ||||
| atf_add_test_case logical | atf_add_test_case logical | ||||
| atf_add_test_case physical | atf_add_test_case physical | ||||
| atf_add_test_case stdout | |||||
| } | } | ||||