Changeset View
Changeset View
Standalone View
Standalone View
contrib/netbsd-tests/usr.bin/cmp/t_cmp.sh
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | skip_body() { | ||||
echo 0123456789abcdef > a | echo 0123456789abcdef > a | ||||
echo abcdef > b | echo abcdef > b | ||||
atf_check -s exit:0 -o empty -e empty -x "cmp a b '10'" | atf_check -s exit:0 -o empty -e empty -x "cmp a b '10'" | ||||
atf_check -s exit:0 -o empty -e empty -x "cmp a b '0xa'" | atf_check -s exit:0 -o empty -e empty -x "cmp a b '0xa'" | ||||
atf_check -s exit:1 -o not-empty -e empty -x "cmp a b '9'" | atf_check -s exit:1 -o not-empty -e empty -x "cmp a b '9'" | ||||
} | } | ||||
atf_test_case special | |||||
special_head() { | |||||
atf_set "descr" "Test cmp(1)'s handling of non-regular files" | |||||
} | |||||
special_body() { | |||||
echo 0123456789abcdef > a | |||||
echo 0123456789abcdeg > b | |||||
cat a | atf_check -s exit:0 -x "cmp a -" | |||||
cat a | atf_check -s exit:0 -x "cmp - a" | |||||
cat b | atf_check -s not-exit:0 -x "cmp a -" | |||||
cat b | atf_check -s not-exit:0 -x "cmp - a" | |||||
true | |||||
} | |||||
atf_test_case symlink | |||||
symlink_head() { | |||||
atf_set "descr" "Test cmp(1)'s handling of symlinks" | |||||
} | |||||
symlink_body() { | |||||
echo 0123456789abcdef > a | |||||
echo 0123456789abcdeg > b | |||||
ln -s a a.lnk | |||||
ln -s b b.lnk | |||||
ln -s a a2.lnk | |||||
cp a adup | |||||
ln -s adup adup.lnk | |||||
atf_check -s exit:0 -x "cmp a a.lnk" | |||||
atf_check -s exit:0 -x "cmp a.lnk a" | |||||
atf_check -s not-exit:0 -o ignore -x "cmp a b.lnk" | |||||
atf_check -s not-exit:0 -o ignore -x "cmp b.lnk a" | |||||
atf_check -s not-exit:0 -o ignore -x -e ignore "cmp -h a a.lnk" | |||||
ngie: `-e ignore -x` for consistency? | |||||
asomersAuthorUnsubmitted Not Done Inline ActionsOk. asomers: Ok. | |||||
atf_check -s not-exit:0 -o ignore -e ignore -x "cmp -h a.lnk a" | |||||
atf_check -s exit:0 -x "cmp -h a.lnk a2.lnk" | |||||
atf_check -s not-exit:0 -o ignore -e ignore -x "cmp -h a.lnk adup.lnk" | |||||
} | |||||
ngieUnsubmitted Not Done Inline ActionsPlease add # Begin FreeBSD and # End FreeBSD to denote the changes we added. ngie: Please add `# Begin FreeBSD` and `# End FreeBSD` to denote the changes we added. | |||||
asomersAuthorUnsubmitted Not Done Inline ActionsI can do that, or I can create a separate test file for our tests. Which would you prefer? asomers: I can do that, or I can create a separate test file for our tests. Which would you prefer? | |||||
ngieUnsubmitted Not Done Inline ActionsI think this makes sense. It might be a good idea to push this back to NetBSD.. ngie: I think this makes sense. It might be a good idea to push this back to NetBSD.. | |||||
atf_init_test_cases() | atf_init_test_cases() | ||||
{ | { | ||||
atf_add_test_case missing | atf_add_test_case missing | ||||
atf_add_test_case skip | atf_add_test_case skip | ||||
atf_add_test_case special | |||||
atf_add_test_case symlink | |||||
} | } |
-e ignore -x for consistency?