Add tests for the environment related commands in csh. While here, print a
authoranton <anton@openbsd.org>
Mon, 18 Dec 2017 19:19:08 +0000 (19:19 +0000)
committeranton <anton@openbsd.org>
Mon, 18 Dec 2017 19:19:08 +0000 (19:19 +0000)
descriptive header before each test, inspired by the many others in regress.

regress/bin/csh/Makefile
regress/bin/csh/env.in [new file with mode: 0644]
regress/bin/csh/env.ok [new file with mode: 0644]

index 16bd73c..b604773 100644 (file)
@@ -1,9 +1,9 @@
-# $OpenBSD: Makefile,v 1.4 2017/11/16 19:05:44 anton Exp $
-
-REGRESS_TARGETS=       filec
+# $OpenBSD: Makefile,v 1.5 2017/12/18 19:19:08 anton Exp $
 
 CSH=   /bin/csh
 
+REGRESS_TARGETS=       filec
+
 PROG=          edit
 CFLAGS+=       -Wall
 LDADD+=                -lutil
@@ -13,6 +13,16 @@ edit.c: ${.CURDIR}/../ksh/edit/edit.c
        @cp ${.CURDIR}/../ksh/edit/edit.c .
 
 filec: edit
+       @echo '\n======== filec ========'
        sh ${.CURDIR}/filec.sh ${CSH}
 
+REGRESS_TARGETS+=      env
+
+.SUFFIXES: .in
+
+.in:
+       @echo '\n======== ${@} ========'
+       env -i MALLOC_OPTIONS=S ${CSH} <${.CURDIR}/${@}.in 2>&1 | \
+               diff -u ${.CURDIR}/${@}.ok -
+
 .include <bsd.regress.mk>
diff --git a/regress/bin/csh/env.in b/regress/bin/csh/env.in
new file mode 100644 (file)
index 0000000..e76d814
--- /dev/null
@@ -0,0 +1,9 @@
+setenv FOO 1
+echo $FOO
+unsetenv FOO
+setenv | grep FOO || echo ok
+setenv FOO 1
+setenv FOOFOO 2
+echo $FOO $FOOFOO
+unsetenv FOO*
+setenv | grep FOO || echo ok
diff --git a/regress/bin/csh/env.ok b/regress/bin/csh/env.ok
new file mode 100644 (file)
index 0000000..15859e8
--- /dev/null
@@ -0,0 +1,4 @@
+1
+ok
+1 2
+ok