commit: a78707a6c9153feb52dc7b63728a2bd46b67536e
parent cab62a7330ebb7211566fe31de78642b7cf3d1b1
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 18 Sep 2024 03:54:54 +0200
test-cmd/mkfifo: Change from cram to tap.sh
Diffstat:
3 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/test-cmd/Kyuafile b/test-cmd/Kyuafile
@@ -30,6 +30,7 @@ tap_test_program{name="join.sh", required_files=basedir.."/cmd/join", timeout=1}
tap_test_program{name="link.sh", required_files=basedir.."/cmd/link", timeout=1}
tap_test_program{name="logname.sh", required_files=basedir.."/cmd/logname", timeout=1}
tap_test_program{name="mkdir.sh", required_files=basedir.."/cmd/mkdir", timeout=1}
+tap_test_program{name="mkfifo.sh", required_files=basedir.."/cmd/mkfifo", timeout=1}
tap_test_program{name="mktemp.sh", required_files=basedir.."/cmd/mktemp", timeout=1}
tap_test_program{name="paste.sh", required_files=basedir.."/cmd/paste", timeout=1}
tap_test_program{name="pathchk.sh", required_files=basedir.."/cmd/pathchk", timeout=1}
diff --git a/test-cmd/mkfifo.sh b/test-cmd/mkfifo.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+# SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
+# SPDX-License-Identifier: MPL-2.0
+
+WD="$(dirname "$0")"
+target="${WD}/../cmd/mkfifo"
+plans=7
+. "${WD}/tap.sh"
+
+t foo foo
+t_cmd foo:test '' test -p foo
+t_cmd foo:rm '' rm foo
+
+t_cmd exists:touch '' touch exists
+t --exit=1 exists exists "mkfifo: Failed creating FIFO at 'exists': File exists
+"
+t_cmd exists:rm '' rm exists
+
+t --exit=1 enotdir /dev/null/e/noent "mkfifo: Failed creating FIFO at '/dev/null/e/noent': Not a directory
+"
diff --git a/test-cmd/mkfifo.t b/test-cmd/mkfifo.t
@@ -1,24 +0,0 @@
-#!/usr/bin/env cram
-# SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
-# SPDX-License-Identifier: MPL-2.0
-
- $ export PATH="$TESTDIR/../cmd:$PATH"
-
- $ test "$(command -v mkfifo)" = "$TESTDIR/../cmd/mkfifo"
-
- $ mkfifo foo
- $ test -p foo
- $ rm foo
-
- $ touch exists
- $ mkfifo exists
- mkfifo: Failed creating FIFO at 'exists': File exists
- [1]
- $ rm exists
-
- $ mkfifo /dev/null/e/no/ent
- mkfifo: Failed creating FIFO at '/dev/null/e/no/ent': Not a directory
- [1]
-
- $ find .
- .