Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145479954
D10444.id27594.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D10444.id27594.diff
View Options
Index: contrib/netbsd-tests/usr.bin/grep/t_grep.sh
===================================================================
--- contrib/netbsd-tests/usr.bin/grep/t_grep.sh
+++ contrib/netbsd-tests/usr.bin/grep/t_grep.sh
@@ -391,6 +391,66 @@
atf_check -o inline:"Eggs\nCheese\n" grep -v -e "^$" test1
}
+
+atf_test_case fgrep_sanity
+fgrep_sanity_head()
+{
+ atf_set "descr" "Check for fgrep sanity, literal expressions only"
+}
+fgrep_sanity_body()
+{
+ printf "Foo" > test1
+
+ atf_check -o inline:"Foo\n" fgrep -e "Foo" test1
+
+ atf_check -s exit:1 -o empty fgrep -e "Fo." test1
+}
+
+atf_test_case egrep_sanity
+egrep_sanity_head()
+{
+ atf_set "descr" "Check for egrep sanity, EREs only"
+}
+egrep_sanity_body()
+{
+ printf "Foobar(ed)" > test1
+ printf "M{1}" > test2
+
+ atf_check -o inline:"Foo\n" egrep -o -e "F.." test1
+
+ atf_check -o inline:"Foobar\n" egrep -o -e "F[a-z]*" test1
+
+ atf_check -o inline:"Fo\n" egrep -o -e "F(o|p)" test1
+
+ atf_check -o inline:"(ed)\n" egrep -o -e "\(ed\)" test1
+
+ atf_check -o inline:"M\n" egrep -o -e "M{1}" test2
+
+ atf_check -o inline:"M{1}\n" egrep -o -e "M\{1\}" test2
+}
+
+atf_test_case grep_sanity
+grep_sanity_head()
+{
+ atf_set "descr" "Check for basic grep sanity, BREs only"
+}
+grep_sanity_body()
+{
+ printf "Foobar(ed)" > test1
+ printf "M{1}" > test2
+
+ atf_check -o inline:"Foo\n" grep -o -e "F.." test1
+
+ atf_check -o inline:"Foobar\n" grep -o -e "F[a-z]*" test1
+
+ atf_check -o inline:"Fo\n" grep -o -e "F\(o\)" test1
+
+ atf_check -o inline:"(ed)\n" grep -o -e "(ed)" test1
+
+ atf_check -o inline:"M{1}\n" grep -o -e "M{1}" test2
+
+ atf_check -o inline:"M\n" grep -o -e "M\{1\}" test2
+}
# End FreeBSD
atf_init_test_cases()
@@ -419,5 +479,8 @@
atf_add_test_case escmap
atf_add_test_case egrep_empty_invalid
atf_add_test_case zerolen
+ atf_add_test_case fgrep_sanity
+ atf_add_test_case egrep_sanity
+ atf_add_test_case grep_sanity
# End FreeBSD
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 21, 9:23 AM (18 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28917949
Default Alt Text
D10444.id27594.diff (1 KB)
Attached To
Mode
D10444: grep(1) testing: More sanity checks, remove atf_expect_fail as now appropriate
Attached
Detach File
Event Timeline
Log In to Comment