logo

utils-std

Collection of commonly available Unix tools
commit: 255a209ba439ae1a61e3ff354013d3d8346934a7
parent 5bf8c96e260bdd43b036d4e90f235f41f4d55d6d
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue, 30 Jul 2024 09:53:01 +0200

test-cmd/head.sh: remplace /dev/null with test-cmd/inputs/empty

Otherwise on BSDs:
  head: Failed reading line from '/dev/null': Inappropriate ioctl for device

Diffstat:

Mtest-cmd/head.sh15++++++++-------
Atest-cmd/inputs/empty0
2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/test-cmd/head.sh b/test-cmd/head.sh @@ -2,9 +2,10 @@ # SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me> # SPDX-License-Identifier: MPL-2.0 -target="$(dirname "$0")/../cmd/head" +WD="$(dirname "$0")/../" +target="${WD}/cmd/head" plans=11 -. "$(dirname "$0")/tap.sh" +. "${WD}/test-cmd/tap.sh" t --input="$(seq 1 20)" 20l '' "$(seq 1 10) " @@ -23,14 +24,14 @@ t --input='' empty '' '' t --input='' empty3l '-n 3' '' t --input='' empty3c '-c 3' '' -t --input="$(seq 1 2)" devnull+2l '- /dev/null' '==> - <== +t --input="$(seq 1 2)" devnull+2l "- ${WD}/test-cmd/inputs/empty" "==> - <== 1 2 -==> /dev/null <== -' +==> ${WD}/test-cmd/inputs/empty <== +" -t --input="$(seq 1 2)" opt_q '-q - /dev/null' '1 +t --input="$(seq 1 2)" opt_q "-q - ${WD}/test-cmd/inputs/empty" '1 2' -t opt_v '-v /dev/null' '==> /dev/null <== +t --input='' opt_v '-v -' '==> - <== ' diff --git a/test-cmd/inputs/empty b/test-cmd/inputs/empty