bonsix/tests/bonsai/dj.sh

30 lines
925 B
Bash
Executable File

#!/bin/sh
# Copyright (c) 2024 DTB <trinity@trinity.moe>
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
# SPDX-License-Identifier: FSFAP
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
. tests/bonsai/test_env
! dj -h
# Linux has a /dev/full pseudodevice useful for testing errors.
case "$(uname)" in
Linux)
dj -Hi /dev/zero -o /dev/full 2>&1 \
| xargs -I out "$BIN"/strcmp '1+0 > 0+0; 1024 > 0' out
;;
esac
# Read nothing from /dev/null, write nothing to /dev/null.
dj -Hi /dev/null -o /dev/null 2>&1 \
| xargs -I out "$BIN"/strcmp '0+0 > 0+0; 0 > 0' out
# Test skipping stdin.
#dd count=1 bs=1024 </dev/zero 2>/dev/null \
# | dj -H -s 24 -o /dev/null 2>&1 \
# | xargs -I out "$BIN"/strcmp '1+0 > 1+0; 1024 > 1000' out