Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/diff/tests/diff_test.sh
# $FreeBSD$ | # $FreeBSD$ | ||||
atf_test_case simple | atf_test_case simple | ||||
atf_test_case unified | atf_test_case unified | ||||
atf_test_case header | atf_test_case header | ||||
atf_test_case header_ns | atf_test_case header_ns | ||||
atf_test_case ifdef | atf_test_case ifdef | ||||
atf_test_case group_format | atf_test_case group_format | ||||
atf_test_case side_by_side | atf_test_case side_by_side | ||||
atf_test_case side_by_side_tabbed | |||||
atf_test_case brief_format | atf_test_case brief_format | ||||
atf_test_case b230049 | atf_test_case b230049 | ||||
atf_test_case stripcr_o | atf_test_case stripcr_o | ||||
atf_test_case b252515 | atf_test_case b252515 | ||||
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 | ||||
▲ Show 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | side_by_side_body() | ||||
atf_check -o match:"$exp_output" -s exit:1 \ | atf_check -o match:"$exp_output" -s exit:1 \ | ||||
diff -y A B | diff -y A B | ||||
atf_check -o match:"$exp_output_suppressed" -s exit:1 \ | atf_check -o match:"$exp_output_suppressed" -s exit:1 \ | ||||
diff -y --suppress-common-lines A B | diff -y --suppress-common-lines A B | ||||
atf_check -o match:"$exp_output_suppressed" -s exit:1 \ | atf_check -o match:"$exp_output_suppressed" -s exit:1 \ | ||||
diff -W 65 -y --suppress-common-lines A B | diff -W 65 -y --suppress-common-lines A B | ||||
} | } | ||||
side_by_side_tabbed_body() | |||||
{ | |||||
file_a=$(atf_get_srcdir)/side_by_side_tabbed_a.in | |||||
file_b=$(atf_get_srcdir)/side_by_side_tabbed_b.in | |||||
atf_check -o save:diffout -s not-exit:0 \ | |||||
diff -y ${file_a} ${file_b} | |||||
atf_check -o save:diffout_expanded -s not-exit:0 \ | |||||
diff -yt ${file_a} ${file_b} | |||||
atf_check -o not-empty grep -Ee 'file A.+file B' diffout | |||||
atf_check -o not-empty grep -Ee 'file A.+file B' diffout_expanded | |||||
atf_check -o not-empty grep -Ee 'tabs.+tabs' diffout | |||||
atf_check -o not-empty grep -Ee 'tabs.+tabs' diffout_expanded | |||||
} | |||||
brief_format_body() | brief_format_body() | ||||
{ | { | ||||
atf_check mkdir A B | atf_check mkdir A B | ||||
atf_check -x "echo 1 > A/test-file" | atf_check -x "echo 1 > A/test-file" | ||||
atf_check -x "echo 2 > B/test-file" | atf_check -x "echo 2 > B/test-file" | ||||
atf_check cp -Rf A C | atf_check cp -Rf A C | ||||
▲ Show 20 Lines • Show All 182 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
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 side_by_side_tabbed | |||||
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 | atf_add_test_case functionname | ||||
atf_add_test_case noderef | atf_add_test_case noderef | ||||
atf_add_test_case ignorecase | atf_add_test_case ignorecase | ||||
} | } |