commit: ef5778ca63bc997f61054f4bffd8b49979c14de7
parent 6b34d055a4e943d49f9fd519848700fada43429d
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Thu, 1 Aug 2024 06:16:48 +0200
test-cmd/sleep: Change from cram to tap.sh
Diffstat:
3 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/test-cmd/Kyuafile b/test-cmd/Kyuafile
@@ -29,6 +29,7 @@ tap_test_program{name="mktemp.sh", required_files=basedir.."/cmd/mktemp", timeou
tap_test_program{name="pwd.sh", required_files=basedir.."/cmd/pwd", timeout=1}
tap_test_program{name="realpath.sh", required_files=basedir.."/cmd/realpath", timeout=1}
tap_test_program{name="seq.sh", required_files=basedir.."/cmd/seq", timeout=1}
+tap_test_program{name="sleep.sh", required_files=basedir.."/cmd/sleep", timeout=1}
tap_test_program{name="strings.sh", required_files=basedir.."/cmd/strings", timeout=1}
tap_test_program{name="test.sh", required_files=basedir.."/cmd/test", timeout=2}
tap_test_program{name="true.sh", required_files=basedir.."/cmd/true", timeout=1}
diff --git a/test-cmd/sleep.sh b/test-cmd/sleep.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+# SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
+# SPDX-License-Identifier: MPL-2.0
+
+target="$(dirname "$0")/../cmd/sleep"
+plans=3
+. "$(dirname "$0")/tap.sh"
+
+t --exit=1 noargs '' 'sleep: Got a total duration of 0
+'
+
+t --exit=1 zero '0' 'sleep: Got a total duration of 0
+'
+
+t zero-one 0.1 ''
diff --git a/test-cmd/sleep.t b/test-cmd/sleep.t
@@ -1,19 +0,0 @@
-#!/usr/bin/env cram
-# SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
-# SPDX-License-Identifier: MPL-2.0
-
- $ cd $TESTDIR/../cmd
-
- $ ./sleep
- sleep: Got a total duration of 0
- [1]
-
- $ ./sleep -f
- strtodur: (Error: Not a number: -f|Error with sscanf: Invalid argument) (re)
- [1]
-
- $ ./sleep 0
- sleep: Got a total duration of 0
- [1]
-
- $ ./sleep 1