Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/diff/tests/diff_test.sh
| Show All 13 Lines | |||||
| atf_test_case Bflag | atf_test_case Bflag | ||||
| atf_test_case Nflag | atf_test_case Nflag | ||||
| atf_test_case tabsize | atf_test_case tabsize | ||||
| atf_test_case conflicting_format | atf_test_case conflicting_format | ||||
| atf_test_case label | atf_test_case label | ||||
| atf_test_case report_identical | atf_test_case report_identical | ||||
| atf_test_case non_regular_file | atf_test_case non_regular_file | ||||
| atf_test_case binary | atf_test_case binary | ||||
| atf_test_case functionname | |||||
| simple_body() | simple_body() | ||||
| { | { | ||||
| atf_check -o file:$(atf_get_srcdir)/simple.out -s eq:1 \ | atf_check -o file:$(atf_get_srcdir)/simple.out -s eq:1 \ | ||||
| diff "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in" | diff "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in" | ||||
| atf_check -o file:$(atf_get_srcdir)/simple_e.out -s eq:1 \ | atf_check -o file:$(atf_get_srcdir)/simple_e.out -s eq:1 \ | ||||
| diff -e "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in" | diff -e "$(atf_get_srcdir)/input1.in" "$(atf_get_srcdir)/input2.in" | ||||
| ▲ Show 20 Lines • Show All 243 Lines • ▼ Show 20 Lines | binary_body() | ||||
| cp A B | cp A B | ||||
| printf '\n\0\n' >> A | printf '\n\0\n' >> A | ||||
| printf '\nx\n' >> B | printf '\nx\n' >> B | ||||
| atf_check -o inline:"Binary files A and B differ\n" -s exit:1 diff A B | atf_check -o inline:"Binary files A and B differ\n" -s exit:1 diff A B | ||||
| atf_check -o inline:"176c\nx\n.\n" -s exit:1 diff -ae A B | atf_check -o inline:"176c\nx\n.\n" -s exit:1 diff -ae A B | ||||
| } | } | ||||
| functionname_body() | |||||
| { | |||||
| atf_check -o empty -x "which diff" | |||||
| atf_check -o file:$(atf_get_srcdir)/functionname_c.out -s exit:1 \ | |||||
| diff -u -p -L functionname.in -L functionname_c.in \ | |||||
| "$(atf_get_srcdir)/functionname.in" "$(atf_get_srcdir)/functionname_c.in" | |||||
| atf_check -o file:$(atf_get_srcdir)/functionname_objcm.out -s exit:1 \ | |||||
| diff -u -p -L functionname.in -L functionname_objcm.in \ | |||||
| "$(atf_get_srcdir)/functionname.in" "$(atf_get_srcdir)/functionname_objcm.in" | |||||
| atf_check -o file:$(atf_get_srcdir)/functionname_objcclassm.out -s exit:1 \ | |||||
| diff -u -p -L functionname.in -L functionname_objcclassm.in \ | |||||
| "$(atf_get_srcdir)/functionname.in" "$(atf_get_srcdir)/functionname_objcclassm.in" | |||||
| } | |||||
| atf_init_test_cases() | atf_init_test_cases() | ||||
| { | { | ||||
| atf_add_test_case simple | atf_add_test_case simple | ||||
| atf_add_test_case unified | atf_add_test_case unified | ||||
| atf_add_test_case header | atf_add_test_case header | ||||
| atf_add_test_case header_ns | atf_add_test_case header_ns | ||||
| atf_add_test_case ifdef | atf_add_test_case ifdef | ||||
| atf_add_test_case group_format | atf_add_test_case group_format | ||||
| atf_add_test_case side_by_side | atf_add_test_case side_by_side | ||||
| atf_add_test_case brief_format | atf_add_test_case brief_format | ||||
| atf_add_test_case b230049 | atf_add_test_case b230049 | ||||
| atf_add_test_case stripcr_o | atf_add_test_case stripcr_o | ||||
| atf_add_test_case b252515 | atf_add_test_case b252515 | ||||
| atf_add_test_case Bflag | atf_add_test_case Bflag | ||||
| atf_add_test_case Nflag | atf_add_test_case Nflag | ||||
| atf_add_test_case tabsize | atf_add_test_case tabsize | ||||
| atf_add_test_case conflicting_format | atf_add_test_case conflicting_format | ||||
| atf_add_test_case label | atf_add_test_case label | ||||
| atf_add_test_case report_identical | atf_add_test_case report_identical | ||||
| atf_add_test_case non_regular_file | atf_add_test_case non_regular_file | ||||
| atf_add_test_case binary | atf_add_test_case binary | ||||
| atf_add_test_case functionname | |||||
| } | } | ||||