Test for file from stdin.
authornicm <nicm@openbsd.org>
Wed, 28 Jun 2017 17:28:39 +0000 (17:28 +0000)
committernicm <nicm@openbsd.org>
Wed, 28 Jun 2017 17:28:39 +0000 (17:28 +0000)
regress/usr.bin/file/Makefile
regress/usr.bin/file/stdin.out [new file with mode: 0644]

index d08124c..dad20ca 100644 (file)
@@ -1,10 +1,10 @@
-# $OpenBSD: Makefile,v 1.7 2016/05/01 11:28:06 nicm Exp $
+# $OpenBSD: Makefile,v 1.8 2017/06/28 17:28:39 nicm Exp $
 
 FILE=file
 
 REGRESS_TARGETS=t0  t1  t2  t3  t4  t5  t6  t7  \
                t8  t9  t10 t11 t15 t17 t18 t19 \
-               t20 t21 t22 t30 t31 t32 t33
+               t20 t21 t22 t30 t31 t32 t33 stdin
 
 # .in:  input file
 # .out: desired result
@@ -20,6 +20,12 @@ all: ${REGRESS_TARGET}
                diff - ${.CURDIR}/${*}.out || \
                (echo "XXX ${*} failed" && false)
 
+stdin:
+       @echo ${*}
+       @${FILE} - <t0.in | \
+               diff - ${.CURDIR}/${*}.out || \
+               (echo "XXX ${*} failed" && false)
+
 clean:
 
 .include <bsd.regress.mk>
diff --git a/regress/usr.bin/file/stdin.out b/regress/usr.bin/file/stdin.out
new file mode 100644 (file)
index 0000000..be8e322
--- /dev/null
@@ -0,0 +1 @@
+/dev/stdin: empty