Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/cmp/tests/cmp_test2.sh
Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | limit_body() | ||||
# Test special, too. The implementation for link is effectively | # Test special, too. The implementation for link is effectively | ||||
# identical. | # identical. | ||||
atf_check -s exit:0 -e empty -x "cat a | cmp -sn 4 b -" | atf_check -s exit:0 -e empty -x "cat a | cmp -sn 4 b -" | ||||
atf_check -s exit:0 -e empty -x "cat a | cmp -sn 3 b -" | atf_check -s exit:0 -e empty -x "cat a | cmp -sn 3 b -" | ||||
atf_check -s exit:1 -o ignore -x "cat a | cmp -sn 5 b -" | atf_check -s exit:1 -o ignore -x "cat a | cmp -sn 5 b -" | ||||
} | } | ||||
atf_test_case bflag | |||||
bflag_head() | |||||
{ | |||||
atf_set "descr" "Test cmp(1) -b (print bytes)" | |||||
} | |||||
bflag_body() | |||||
{ | |||||
echo -n "abcd" > a | |||||
echo -n "abdd" > b | |||||
atf_check -s exit:1 -o file:$(atf_get_srcdir)/b_flag.out \ | |||||
cmp -b a b | |||||
atf_check -s exit:1 -o file:$(atf_get_srcdir)/bl_flag.out \ | |||||
cmp -bl a b | |||||
} | |||||
atf_init_test_cases() | atf_init_test_cases() | ||||
{ | { | ||||
atf_add_test_case special | atf_add_test_case special | ||||
atf_add_test_case symlink | atf_add_test_case symlink | ||||
atf_add_test_case pr252542 | atf_add_test_case pr252542 | ||||
atf_add_test_case skipsuff | atf_add_test_case skipsuff | ||||
atf_add_test_case limit | atf_add_test_case limit | ||||
atf_add_test_case bflag | |||||
} | } |