Changeset View
Changeset View
Standalone View
Standalone View
contrib/netbsd-tests/usr.bin/grep/t_grep.sh
Show First 20 Lines • Show All 363 Lines • ▼ Show 20 Lines | |||||
atf_test_case egrep_empty_invalid | atf_test_case egrep_empty_invalid | ||||
egrep_empty_invalid_head() | egrep_empty_invalid_head() | ||||
{ | { | ||||
atf_set "descr" "Check for handling of an invalid empty pattern (PR 194823)" | atf_set "descr" "Check for handling of an invalid empty pattern (PR 194823)" | ||||
} | } | ||||
egrep_empty_invalid_body() | egrep_empty_invalid_body() | ||||
{ | { | ||||
atf_check -s exit:1 egrep '{' /dev/null | atf_check -e ignore -s not-exit:0 egrep '{' /dev/null | ||||
ngie: 0 vs 1 has a distinct meaning with grep, and the above change loosens the exit code check. Per… | |||||
kevansAuthorUnsubmitted Not Done Inline ActionsI'm expecting either: 1 or >1. For this particular expression, undefined behavior is abound and "{" could be either an error or some other valid interpretation, but in any case it should not die and at the very least not produce a match against /dev/null. kevans: I'm expecting either: `1` or `>1`. For this particular expression, undefined behavior is abound… | |||||
ngieUnsubmitted Not Done Inline ActionsOk -- I agree. ngie: Ok -- I agree. | |||||
} | } | ||||
atf_test_case zerolen | atf_test_case zerolen | ||||
zerolen_head() | zerolen_head() | ||||
{ | { | ||||
atf_set "descr" "Check for successful zero-length matches with ^$" | atf_set "descr" "Check for successful zero-length matches with ^$" | ||||
} | } | ||||
zerolen_body() | zerolen_body() | ||||
▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines |
0 vs 1 has a distinct meaning with grep, and the above change loosens the exit code check. Per http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html :
Which behavior are you expecting should be triggered: >1?