summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2005-04-03 19:15:17 +0000
committerotto <otto@openbsd.org>2005-04-03 19:15:17 +0000
commit4302e70fa470971df936f07114f479d1177edb31 (patch)
tree7bb0fb4994aca4a2a6670c2c86ef6192e312cb3d
parentProtect begin and end of word markers added to the pattern when (diff)
downloadwireguard-openbsd-4302e70fa470971df936f07114f479d1177edb31.tar.xz
wireguard-openbsd-4302e70fa470971df936f07114f479d1177edb31.zip
Test for egrep -w "foo|bar"
-rw-r--r--regress/usr.bin/grep/Makefile9
-rw-r--r--regress/usr.bin/grep/t23.in7
-rw-r--r--regress/usr.bin/grep/t23.out5
3 files changed, 18 insertions, 3 deletions
diff --git a/regress/usr.bin/grep/Makefile b/regress/usr.bin/grep/Makefile
index 9c58d59b4c0..e590df2bb6a 100644
--- a/regress/usr.bin/grep/Makefile
+++ b/regress/usr.bin/grep/Makefile
@@ -1,7 +1,7 @@
-# $OpenBSD: Makefile,v 1.11 2004/10/03 19:24:58 otto Exp $
+# $OpenBSD: Makefile,v 1.12 2005/04/03 19:15:17 otto Exp $
REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 \
- t18 t19 t20 t21 t22
+ t18 t19 t20 t21 t22 t23
t1:
grep t.s ${.CURDIR}/in | diff - ${.CURDIR}/t1.out
@@ -88,7 +88,10 @@ t21:
t22:
grep -l 'a.*b' ${.CURDIR}/t22.in
+t23:
+ egrep -w 'word1|word2|word3' ${.CURDIR}/t23.in
+
.PHONY: t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20
-.PHONY: t21 t22
+.PHONY: t21 t22 t23
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/grep/t23.in b/regress/usr.bin/grep/t23.in
new file mode 100644
index 00000000000..e75a4be9ea9
--- /dev/null
+++ b/regress/usr.bin/grep/t23.in
@@ -0,0 +1,7 @@
+word1
+word1-hyphen
+word1underscore
+nomatch
+word2|
+|word2|
+-word3-
diff --git a/regress/usr.bin/grep/t23.out b/regress/usr.bin/grep/t23.out
new file mode 100644
index 00000000000..2a69739c20f
--- /dev/null
+++ b/regress/usr.bin/grep/t23.out
@@ -0,0 +1,5 @@
+word1
+word1-hyphen
+word2|
+|word2|
+-word3-