Add regress test for multiple negation characters.
authormillert <millert@openbsd.org>
Tue, 23 Jun 2015 22:53:14 +0000 (22:53 +0000)
committermillert <millert@openbsd.org>
Tue, 23 Jun 2015 22:53:14 +0000 (22:53 +0000)
regress/usr.bin/sed/Makefile
regress/usr.bin/sed/negation.expected [new file with mode: 0644]

index 826ef2c..cf380d0 100644 (file)
@@ -1,9 +1,9 @@
-#      $OpenBSD: Makefile,v 1.3 2011/06/23 11:53:57 schwarze Exp $
+#      $OpenBSD: Makefile,v 1.4 2015/06/23 22:53:14 millert Exp $
 #      $NetBSD: Makefile,v 1.1 2005/04/04 16:48:45 peter Exp $
 
 SED=   /usr/bin/sed
 
-REGRESS_TARGETS= sedtest substitute hanoi math sierpinski
+REGRESS_TARGETS= sedtest substitute hanoi math sierpinski negation
 
 sedtest:
        sh ${.CURDIR}/$@.sh ${SED} $@.out
@@ -24,6 +24,10 @@ sierpinski:
        ${SED} -nf ${.CURDIR}/$@.sed ${.CURDIR}/$@.in > $@.out
        diff ${.CURDIR}/$@.expected $@.out
 
+negation:
+       echo foo | ${SED} "1!!s/foo/bar/" > $@.out
+       diff ${.CURDIR}/$@.expected $@.out
+
 CLEANFILES+=*.out lines* script*
 
 .include <bsd.regress.mk>
diff --git a/regress/usr.bin/sed/negation.expected b/regress/usr.bin/sed/negation.expected
new file mode 100644 (file)
index 0000000..257cc56
--- /dev/null
@@ -0,0 +1 @@
+foo