2024-04-24 14:58:35 -06:00
|
|
|
#!/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.
|
|
|
|
|
2024-04-25 18:57:05 -06:00
|
|
|
. tests/bonsai/test_env
|
2024-04-24 15:22:07 -06:00
|
|
|
|
2024-04-24 14:58:35 -06:00
|
|
|
! dj -h
|
|
|
|
|
2024-07-08 22:25:18 -06:00
|
|
|
# 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
|
2024-04-24 14:58:35 -06:00
|
|
|
|
|
|
|
# Read nothing from /dev/null, write nothing to /dev/null.
|
2024-07-08 22:25:18 -06:00
|
|
|
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
|