Add some tests from kshe48@zoho.com. Currently failing, but will be fixed soon.
authorotto <otto@openbsd.org>
Mon, 12 Jun 2017 16:58:31 +0000 (16:58 +0000)
committerotto <otto@openbsd.org>
Mon, 12 Jun 2017 16:58:31 +0000 (16:58 +0000)
regress/usr.bin/sed/Makefile
regress/usr.bin/sed/commandD1.expected [new file with mode: 0644]
regress/usr.bin/sed/commandD1.sed [new file with mode: 0644]
regress/usr.bin/sed/commandc1.expected [new file with mode: 0644]
regress/usr.bin/sed/commandc1.sed [new file with mode: 0644]
regress/usr.bin/sed/commandl1.expected [new file with mode: 0644]
regress/usr.bin/sed/commandl1.sed [new file with mode: 0644]
regress/usr.bin/sed/commandl2.expected [new file with mode: 0644]
regress/usr.bin/sed/commandl2.sed [new file with mode: 0644]

index 5773025..074adff 100644 (file)
@@ -1,10 +1,10 @@
-#      $OpenBSD: Makefile,v 1.5 2015/07/17 20:42:03 jasper Exp $
+#      $OpenBSD: Makefile,v 1.6 2017/06/12 16:58:31 otto 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 negation \
-       inplace inplace2 inplace3
+       inplace inplace2 inplace3 commandl1 commandl2 commandc1 commandD1
 
 sedtest:
        sh ${.CURDIR}/$@.sh ${SED} $@.out
@@ -44,6 +44,23 @@ inplace3:
        ${SED} -i 's/#PermitRootLogin no/PermitRootLogin yes/g' $@.txt
        diff ${.CURDIR}/$@.expected $@.txt
 
+commandl1:
+       printf 'a\nbb\n' | ${SED} -f ${.CURDIR}/$@.sed > $@.out
+       diff ${.CURDIR}/$@.expected $@.out
+
+commandl2:
+       printf 'abc' | ${SED} -f ${.CURDIR}/$@.sed > $@.out
+       diff ${.CURDIR}/$@.expected $@.out
+
+commandc1:
+       printf 'abc' | ${SED} -f ${.CURDIR}/$@.sed > $@.out
+       diff ${.CURDIR}/$@.expected $@.out
+
+commandD1:
+       printf 'a\nbb\n' | ${SED} -f ${.CURDIR}/$@.sed > $@.out
+       diff ${.CURDIR}/$@.expected $@.out
+
+
 CLEANFILES+=*.out lines* script* *.txt
 
 .include <bsd.regress.mk>
diff --git a/regress/usr.bin/sed/commandD1.expected b/regress/usr.bin/sed/commandD1.expected
new file mode 100644 (file)
index 0000000..b6a9a90
--- /dev/null
@@ -0,0 +1 @@
+bbx
diff --git a/regress/usr.bin/sed/commandD1.sed b/regress/usr.bin/sed/commandD1.sed
new file mode 100644 (file)
index 0000000..a07c6c8
--- /dev/null
@@ -0,0 +1 @@
+${s/.$/&x/;q;};N;D
diff --git a/regress/usr.bin/sed/commandc1.expected b/regress/usr.bin/sed/commandc1.expected
new file mode 100644 (file)
index 0000000..8e27be7
--- /dev/null
@@ -0,0 +1 @@
+text
diff --git a/regress/usr.bin/sed/commandc1.sed b/regress/usr.bin/sed/commandc1.sed
new file mode 100644 (file)
index 0000000..fb512bc
--- /dev/null
@@ -0,0 +1,3 @@
+c\
+text
+s/.*//
diff --git a/regress/usr.bin/sed/commandl1.expected b/regress/usr.bin/sed/commandl1.expected
new file mode 100644 (file)
index 0000000..1945aac
--- /dev/null
@@ -0,0 +1,2 @@
+bb$
+bb
diff --git a/regress/usr.bin/sed/commandl1.sed b/regress/usr.bin/sed/commandl1.sed
new file mode 100644 (file)
index 0000000..091d5f4
--- /dev/null
@@ -0,0 +1 @@
+${l;q;};N;D
diff --git a/regress/usr.bin/sed/commandl2.expected b/regress/usr.bin/sed/commandl2.expected
new file mode 100644 (file)
index 0000000..4fbdeab
--- /dev/null
@@ -0,0 +1,2 @@
+text
+$
diff --git a/regress/usr.bin/sed/commandl2.sed b/regress/usr.bin/sed/commandl2.sed
new file mode 100644 (file)
index 0000000..6d2b266
--- /dev/null
@@ -0,0 +1,3 @@
+c\                                                    
+text
+l