Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 2021 19:39:02 GMT
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 13860e71eb50 - main - diff: add a test case for failed -s option
Message-ID:  <202101251939.10PJd2fG079171@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by bapt:

URL: https://cgit.FreeBSD.org/src/commit/?id=13860e71eb501f498a2263f44ea9244f6830b61c

commit 13860e71eb501f498a2263f44ea9244f6830b61c
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2021-01-25 17:40:12 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2021-01-25 19:37:58 +0000

    diff: add a test case for failed -s option
---
 usr.bin/diff/tests/diff_test.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

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
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101251939.10PJd2fG079171>