summaryrefslogtreecommitdiff
path: root/usr.bin/diff/tests
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2020-04-28 14:33:33 +0000
committerKyle Evans <kevans@FreeBSD.org>2020-04-28 14:33:33 +0000
commit67c907653e3cfcc807c96e3419bacce3b5479f1c (patch)
tree2c5684d095ccab11dbd23a0f8686f886be9497e4 /usr.bin/diff/tests
parenta9ea09e548882b7b15bcff47509b3d42618815cf (diff)
downloadsrc-test2-67c907653e3cfcc807c96e3419bacce3b5479f1c.tar.gz
src-test2-67c907653e3cfcc807c96e3419bacce3b5479f1c.zip
diff(1): don't reject specifying the same format multiple times
This may happen, for instance, if one happens to have an alias of diff to diff -up and attempts to specify the amount of context on top of that. Aliases like this may cause other problems, but if they're really not ever generating non-unified diffs then we should at least not break that use-case. In addition, we'll now pick up a format mismatch if -p is specified with !contextual && !unified && !unset. Fix up a small trailing whitespace nit in the tests while we're here, and add tests to make sure that we can double up all the formatting options. Reported by: jbeich MFC after: 3 days
Notes
Notes: svn path=/head/; revision=360437
Diffstat (limited to 'usr.bin/diff/tests')
-rwxr-xr-xusr.bin/diff/tests/diff_test.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh
index 8385a6224865..6f4b484b3a37 100755
--- a/usr.bin/diff/tests/diff_test.sh
+++ b/usr.bin/diff/tests/diff_test.sh
@@ -186,6 +186,13 @@ conflicting_format_body()
atf_check -s exit:2 -e ignore diff -q -c A B
atf_check -s exit:2 -e ignore diff --normal -c A B
atf_check -s exit:2 -e ignore diff -c --normal A B
+
+ atf_check -s exit:1 -o ignore -e ignore diff -u -u A B
+ atf_check -s exit:1 -o ignore -e ignore diff -e -e A B
+ atf_check -s exit:1 -o ignore -e ignore diff -y -y A B
+ atf_check -s exit:1 -o ignore -e ignore diff -q -q A B
+ atf_check -s exit:1 -o ignore -e ignore diff -c -c A B
+ atf_check -s exit:1 -o ignore -e ignore diff --normal --normal A B
}
atf_init_test_cases()
@@ -201,5 +208,5 @@ atf_init_test_cases()
atf_add_test_case b230049
atf_add_test_case Bflag
atf_add_test_case tabsize
- atf_add_test_case conflicting_format
+ atf_add_test_case conflicting_format
}