Changeset View
Changeset View
Standalone View
Standalone View
contrib/netbsd-tests/usr.bin/grep/t_grep.sh
Show First 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | |||||
zgrep_body() | zgrep_body() | ||||
{ | { | ||||
cp "$(atf_get_srcdir)/d_input" . | cp "$(atf_get_srcdir)/d_input" . | ||||
gzip d_input || atf_fail "gzip failed" | gzip d_input || atf_fail "gzip failed" | ||||
atf_check -o file:"$(atf_get_srcdir)/d_zgrep.out" zgrep -h line d_input.gz | atf_check -o file:"$(atf_get_srcdir)/d_zgrep.out" zgrep -h line d_input.gz | ||||
} | } | ||||
atf_test_case zgrep_combined_flags | |||||
zgrep_combined_flags_head() | |||||
{ | |||||
atf_set "descr" "Checks for zgrep wrapper problems with combined flags (PR 247126)" | |||||
} | |||||
zgrep_combined_flags_body() | |||||
{ | |||||
echo 'foo bar' > test | |||||
atf_check -o inline:"foo bar\n" zgrep -we foo test | |||||
atf_skip "known but unsolved regression" | |||||
# Avoid hang on reading from stdin in the failure case | |||||
atf_check -o inline:"foo bar\n" zgrep -wefoo test < /dev/null | |||||
} | |||||
atf_test_case zgrep_eflag | |||||
zgrep_eflag_head() | |||||
{ | |||||
atf_set "descr" "Checks for zgrep wrapper problems with -e PATTERN (PR 247126)" | |||||
} | |||||
zgrep_eflag_body() | |||||
{ | |||||
echo 'foo bar' > test | |||||
# Avoid hang on reading from stdin in the failure case | |||||
atf_check -o inline:"foo bar\n" zgrep -e 'foo bar' test < /dev/null | |||||
atf_check -o inline:"foo bar\n" zgrep --regexp='foo bar' test < /dev/null | |||||
} | |||||
atf_test_case zgrep_fflag | |||||
zgrep_fflag_head() | |||||
{ | |||||
atf_set "descr" "Checks for zgrep wrapper problems with -f FILE (PR 247126)" | |||||
} | |||||
zgrep_fflag_body() | |||||
{ | |||||
echo foo > pattern | |||||
echo foobar > test | |||||
# Avoid hang on reading from stdin in the failure case | |||||
atf_check -o inline:"foobar\n" zgrep -f pattern test </dev/null | |||||
atf_check -o inline:"foobar\n" zgrep --file=pattern test </dev/null | |||||
} | |||||
atf_test_case zgrep_long_eflag | |||||
zgrep_long_eflag_head() | |||||
{ | |||||
atf_set "descr" "Checks for zgrep wrapper problems with --ignore-case reading from stdin (PR 247126)" | |||||
} | |||||
zgrep_long_eflag_body() | |||||
{ | |||||
echo foobar > test | |||||
atf_check -o inline:"foobar\n" zgrep -e foo --ignore-case < test | |||||
} | |||||
atf_test_case zgrep_multiple_eflags | |||||
zgrep_multiple_eflags_head() | |||||
{ | |||||
atf_set "descr" "Checks for zgrep wrapper problems with multiple -e flags (PR 247126)" | |||||
} | |||||
zgrep_multiple_eflags_body() | |||||
{ | |||||
atf_skip "known but unsolved regression" | |||||
echo foobar > test | |||||
atf_check -o inline:"foobar\n" zgrep -e foo -e xxx test | |||||
} | |||||
atf_test_case zgrep_eflags_quotes | |||||
zgrep_eflags_quotes_head() | |||||
{ | |||||
atf_set "descr" "Checks for zgrep wrapper problems with -e flags containing quotes (PR 247126)" | |||||
} | |||||
zgrep_eflags_quotes_body() | |||||
{ | |||||
atf_skip "known but unsolved regression" | |||||
echo "'foo bar'" > test2 | |||||
echo '"foo bar"' >> test2 | |||||
atf_check -o inline:"'foo bar'\n\"foo bar\"\n" zgrep -e "'foo bar'" -e '"foo bar"' test2 | |||||
} | |||||
atf_test_case zgrep_empty_eflag | |||||
zgrep_empty_eflag_head() | |||||
{ | |||||
atf_set "descr" "Checks for zgrep wrapper problems with empty -e flags pattern (PR 247126)" | |||||
} | |||||
zgrep_empty_eflag_body() | |||||
{ | |||||
echo foobar > test | |||||
atf_check -o inline:"foobar\n" zgrep -e '' test | |||||
} | |||||
atf_test_case nonexistent | atf_test_case nonexistent | ||||
nonexistent_head() | nonexistent_head() | ||||
{ | { | ||||
atf_set "descr" "Checks that -s flag suppresses error" \ | atf_set "descr" "Checks that -s flag suppresses error" \ | ||||
"messages about nonexistent files" | "messages about nonexistent files" | ||||
} | } | ||||
nonexistent_body() | nonexistent_body() | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 596 Lines • ▼ Show 20 Lines | atf_init_test_cases() | ||||
atf_add_test_case ignore_case | atf_add_test_case ignore_case | ||||
atf_add_test_case invert | atf_add_test_case invert | ||||
atf_add_test_case whole_line | atf_add_test_case whole_line | ||||
atf_add_test_case negative | atf_add_test_case negative | ||||
atf_add_test_case context | atf_add_test_case context | ||||
atf_add_test_case file_exp | atf_add_test_case file_exp | ||||
atf_add_test_case egrep | atf_add_test_case egrep | ||||
atf_add_test_case zgrep | atf_add_test_case zgrep | ||||
atf_add_test_case zgrep_combined_flags | |||||
atf_add_test_case zgrep_eflag | |||||
atf_add_test_case zgrep_eflags_quotes | |||||
atf_add_test_case zgrep_empty_eflag | |||||
atf_add_test_case zgrep_fflag | |||||
atf_add_test_case zgrep_long_eflag | |||||
atf_add_test_case zgrep_multiple_eflags | |||||
atf_add_test_case nonexistent | atf_add_test_case nonexistent | ||||
atf_add_test_case context2 | atf_add_test_case context2 | ||||
# Begin FreeBSD | # Begin FreeBSD | ||||
atf_add_test_case oflag_zerolen | atf_add_test_case oflag_zerolen | ||||
atf_add_test_case xflag | atf_add_test_case xflag | ||||
atf_add_test_case color | atf_add_test_case color | ||||
atf_add_test_case f_file_empty | atf_add_test_case f_file_empty | ||||
atf_add_test_case escmap | atf_add_test_case escmap | ||||
Show All 23 Lines |