aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2018-06-07 18:06:01 +0000
committerKyle Evans <kevans@FreeBSD.org>2018-06-07 18:06:01 +0000
commitce024bdc0c7e70c5bc32ddd2329ccd04ab747514 (patch)
tree928a733e44113b7fbc4740dc93bbc255037fb1a7
parent943defc3a0fcfb3242f1d7af7314e715080d2807 (diff)
downloadsrc-ce024bdc0c7e70c5bc32ddd2329ccd04ab747514.tar.gz
src-ce024bdc0c7e70c5bc32ddd2329ccd04ab747514.zip
netbsd-tests: grep(1): Add test for -c flag
Someone might be inclined to accidentally break this. someone might have written said test because they broke it locally.
Notes
Notes: svn path=/head/; revision=334803
-rwxr-xr-xcontrib/netbsd-tests/usr.bin/grep/t_grep.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
index 6c221ebb0dba..9ac20e182f09 100755
--- a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
+++ b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh
@@ -716,6 +716,22 @@ fgrep_oflag_body()
atf_check -s exit:1 grep -Fo "ghix" test1
atf_check -s exit:1 grep -Fo "abcdefghiklmnopqrstuvwxyz" test1
}
+
+atf_test_case cflag
+cflag_head()
+{
+ atf_set "descr" "Check proper handling of -c"
+}
+cflag_body()
+{
+ printf "a\nb\nc\n" > test1
+
+ atf_check -o inline:"1\n" grep -Ec "a" test1
+ atf_check -o inline:"2\n" grep -Ec "a|b" test1
+ atf_check -o inline:"3\n" grep -Ec "a|b|c" test1
+
+ atf_check -o inline:"test1:2\n" grep -EHc "a|b" test1
+}
# End FreeBSD
atf_init_test_cases()
@@ -759,5 +775,6 @@ atf_init_test_cases()
atf_add_test_case fgrep_multipattern
atf_add_test_case fgrep_icase
atf_add_test_case fgrep_oflag
+ atf_add_test_case cflag
# End FreeBSD
}