summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-11-07 10:26:00 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-11-07 10:26:00 +0000
commit2425e7927173805fe31f4a52ea1604784e85bddf (patch)
treecaa880d1658ec08abd6b92403707ecb9fe068536 /regress
parent221b664a9d19de48b68cbc473c347f139d548dfd (diff)
handle special-case + in gnu regexps.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/m4/Makefile7
-rw-r--r--regress/usr.bin/m4/gnupatterns.m43
-rw-r--r--regress/usr.bin/m4/gnupatterns.out3
3 files changed, 11 insertions, 2 deletions
diff --git a/regress/usr.bin/m4/Makefile b/regress/usr.bin/m4/Makefile
index cbbb094f6b3..f07021e577e 100644
--- a/regress/usr.bin/m4/Makefile
+++ b/regress/usr.bin/m4/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.18 2004/05/12 21:24:37 espie Exp $
+# $OpenBSD: Makefile,v 1.19 2004/11/07 10:25:59 espie Exp $
FIBOMAX=25
M4=m4
@@ -8,7 +8,7 @@ CLEANFILES+= ff_after_dnl.m4 strangequotes.m4 fibo.out
REGRESS_TARGETS= test-ff_after_dnl test-m4wrap test-m4wrap2 test-fibo \
test-patterns trip test-strangequotes test-redef test-quotes \
- test-weird test-args test-esyscmd test-eval
+ test-weird test-args test-esyscmd test-eval test-gnupatterns
test-ff_after_dnl: ff_after_dnl.m4
${M4} ff_after_dnl.m4 | diff - ${.CURDIR}/ff_after_dnl.out
@@ -25,6 +25,9 @@ test-m4wrap2:
test-patterns:
${M4} ${.CURDIR}/patterns.m4 | diff - ${.CURDIR}/patterns.out
+test-gnupatterns:
+ ${M4} -g ${.CURDIR}/gnupatterns.m4 | diff - ${.CURDIR}/gnupatterns.out
+
fibo.out:
perl ${.CURDIR}/fibo.pl ${FIBOMAX} >$@
diff --git a/regress/usr.bin/m4/gnupatterns.m4 b/regress/usr.bin/m4/gnupatterns.m4
new file mode 100644
index 00000000000..8670d1c44f4
--- /dev/null
+++ b/regress/usr.bin/m4/gnupatterns.m4
@@ -0,0 +1,3 @@
+patsubst(`string with a + to replace with a minus', `+', `minus')
+patsubst(`string with aaaaa to replace with a b', `a+', `b')
+patsubst(`+string with a starting + to replace with a minus', `^+', `minus')
diff --git a/regress/usr.bin/m4/gnupatterns.out b/regress/usr.bin/m4/gnupatterns.out
new file mode 100644
index 00000000000..8e311030193
--- /dev/null
+++ b/regress/usr.bin/m4/gnupatterns.out
@@ -0,0 +1,3 @@
+string with a minus to replace with a minus
+string with b to replbce with b b
+minusstring with a starting + to replace with a minus