mirror of
https://git.freebsd.org/src.git
synced 2026-01-11 19:57:22 +00:00
grep: add testcase to test color when matches is greater than MAX_MATCHES
Reviewed by: imp, kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/1442
This commit is contained in:
parent
a3d472219c
commit
0a5535d1c5
3 changed files with 8 additions and 0 deletions
1
contrib/netbsd-tests/usr.bin/grep/d_color_d.out
Normal file
1
contrib/netbsd-tests/usr.bin/grep/d_color_d.out
Normal file
|
|
@ -0,0 +1 @@
|
|||
[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar[01;31m[Kfoo[m[Kbar
|
||||
|
|
@ -422,6 +422,12 @@ color_body()
|
|||
|
||||
atf_check -o file:"$(atf_get_srcdir)/d_color_c.out" \
|
||||
grep --color=always -f grepfile "$(atf_get_srcdir)/d_color_b.in"
|
||||
# Begin FreeBSD
|
||||
MAX_MATCHES=32
|
||||
for _ in $(seq $((MAX_MATCHES + 1))); do printf "foobar"; done > grepfile
|
||||
atf_check -o file:"$(atf_get_srcdir)/d_color_d.out" \
|
||||
grep --color=always foo grepfile
|
||||
# End FreeBSD
|
||||
}
|
||||
|
||||
atf_test_case f_file_empty
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ ${PACKAGE}FILES+= d_color_a.out
|
|||
${PACKAGE}FILES+= d_color_b.in
|
||||
${PACKAGE}FILES+= d_color_b.out
|
||||
${PACKAGE}FILES+= d_color_c.out
|
||||
${PACKAGE}FILES+= d_color_d.out
|
||||
${PACKAGE}FILES+= d_context2_a.out
|
||||
${PACKAGE}FILES+= d_context2_b.out
|
||||
${PACKAGE}FILES+= d_context2_c.out
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue