aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2021-01-25 17:40:12 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2021-01-25 19:37:58 +0000
commit13860e71eb501f498a2263f44ea9244f6830b61c (patch)
tree8ec3dfde47a9677fd80ccb4e67f3ac1bd35d3e04 /usr.bin
parent94ac312a71683a3a1a928c6adfe927d6bb45044f (diff)
downloadsrc-13860e71eb501f498a2263f44ea9244f6830b61c.tar.gz
src-13860e71eb501f498a2263f44ea9244f6830b61c.zip
diff: add a test case for failed -s option
Diffstat (limited to 'usr.bin')
-rwxr-xr-xusr.bin/diff/tests/diff_test.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh
index 7ee88d1fe607..6da2bbaea34d 100755
--- a/usr.bin/diff/tests/diff_test.sh
+++ b/usr.bin/diff/tests/diff_test.sh
@@ -15,6 +15,7 @@ atf_test_case Nflag
atf_test_case tabsize
atf_test_case conflicting_format
atf_test_case label
+atf_test_case report_identical
simple_body()
{
@@ -226,6 +227,15 @@ label_body()
-s exit:1 diff --label hello --label world `which diff` `which ls`
}
+report_identical_body()
+{
+ printf "\tA\n" > A
+ printf "\tB\n" > B
+ chmod -r B
+ atf_check -s exit:2 -e inline:"diff: B: Permission denied\n" \
+ -o empty diff -s A B
+}
+
atf_init_test_cases()
{
atf_add_test_case simple
@@ -243,4 +253,5 @@ atf_init_test_cases()
atf_add_test_case tabsize
atf_add_test_case conflicting_format
atf_add_test_case label
+ atf_add_test_case report_identical
}