Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/cmp/tests/cmp_test2.sh
Show All 23 Lines | |||||
# | # | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
atf_test_case special | atf_test_case special | ||||
special_head() { | special_head() { | ||||
atf_set "descr" "Test cmp(1)'s handling of non-regular files" | atf_set "descr" "Test cmp(1)'s handling of non-regular files" | ||||
} | } | ||||
special_body() { | special_body() { | ||||
# NOTE: Cannot use pipelines for this because FreeBSD's sh(1) | |||||
# executes the last component of a pipeline in a subprocess | |||||
# (which makes atf_check not register errors since its state | |||||
# is kept in the main process). | |||||
echo 0123456789abcdef > a | echo 0123456789abcdef > a | ||||
echo 0123456789abcdeg > b | echo 0123456789abcdeg > b | ||||
cat a | atf_check -s exit:0 cmp a - | mkfifo a.fifo b.fifo | ||||
cat a | atf_check -s exit:0 cmp - a | cat a > a.fifo & | ||||
cat b | atf_check -s not-exit:0 cmp a - | atf_check -s exit:0 cmp a a.fifo | ||||
cat b | atf_check -s not-exit:0 cmp - a | cat a > a.fifo & | ||||
atf_check -s exit:0 cmp a.fifo a | |||||
cat b > b.fifo & | |||||
atf_check -o not-empty -s not-exit:0 cmp a b.fifo | |||||
cat b > b.fifo & | |||||
atf_check -o not-empty -s not-exit:0 cmp b.fifo a | |||||
wait | |||||
true | true | ||||
} | } | ||||
atf_test_case symlink | atf_test_case symlink | ||||
symlink_head() { | symlink_head() { | ||||
atf_set "descr" "Test cmp(1)'s handling of symlinks" | atf_set "descr" "Test cmp(1)'s handling of symlinks" | ||||
} | } | ||||
symlink_body() { | symlink_body() { | ||||
Show All 22 Lines |