summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2017-06-12 16:58:32 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2017-06-12 16:58:32 +0000
commit28290bb013e64ca8a9c07965f35c91d0438ca7de (patch)
tree56aebcc10188148caf04fcad431c9cc4274db3c7 /regress
parent8c30fbb916aede5a237fdea2486bcdbb1d288031 (diff)
Add some tests from kshe48@zoho.com. Currently failing, but will be fixed soon.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/sed/Makefile21
-rw-r--r--regress/usr.bin/sed/commandD1.expected1
-rw-r--r--regress/usr.bin/sed/commandD1.sed1
-rw-r--r--regress/usr.bin/sed/commandc1.expected1
-rw-r--r--regress/usr.bin/sed/commandc1.sed3
-rw-r--r--regress/usr.bin/sed/commandl1.expected2
-rw-r--r--regress/usr.bin/sed/commandl1.sed1
-rw-r--r--regress/usr.bin/sed/commandl2.expected2
-rw-r--r--regress/usr.bin/sed/commandl2.sed3
9 files changed, 33 insertions, 2 deletions
diff --git a/regress/usr.bin/sed/Makefile b/regress/usr.bin/sed/Makefile
index 57730250a75..074adff9a8b 100644
--- a/regress/usr.bin/sed/Makefile
+++ b/regress/usr.bin/sed/Makefile
@@ -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
index 00000000000..b6a9a9080c8
--- /dev/null
+++ b/regress/usr.bin/sed/commandD1.expected
@@ -0,0 +1 @@
+bbx
diff --git a/regress/usr.bin/sed/commandD1.sed b/regress/usr.bin/sed/commandD1.sed
new file mode 100644
index 00000000000..a07c6c867a1
--- /dev/null
+++ b/regress/usr.bin/sed/commandD1.sed
@@ -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
index 00000000000..8e27be7d615
--- /dev/null
+++ b/regress/usr.bin/sed/commandc1.expected
@@ -0,0 +1 @@
+text
diff --git a/regress/usr.bin/sed/commandc1.sed b/regress/usr.bin/sed/commandc1.sed
new file mode 100644
index 00000000000..fb512bc283a
--- /dev/null
+++ b/regress/usr.bin/sed/commandc1.sed
@@ -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
index 00000000000..1945aac9969
--- /dev/null
+++ b/regress/usr.bin/sed/commandl1.expected
@@ -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
index 00000000000..091d5f48a6a
--- /dev/null
+++ b/regress/usr.bin/sed/commandl1.sed
@@ -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
index 00000000000..4fbdeab3d18
--- /dev/null
+++ b/regress/usr.bin/sed/commandl2.expected
@@ -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
index 00000000000..6d2b266577e
--- /dev/null
+++ b/regress/usr.bin/sed/commandl2.sed
@@ -0,0 +1,3 @@
+c\
+text
+l