tests: fixed aliasing and created mm.sh
This commit is contained in:
parent
057f5571d6
commit
aefa87d9e5
3
tests/bonsai/aliases
Normal file
3
tests/bonsai/aliases
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
alias "$UTIL=$BIN/$UTIL"
|
@ -7,6 +7,8 @@
|
||||
# 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/aliases
|
||||
|
||||
! dj -h
|
||||
|
||||
# This test is theoretically Linux-dependent; write(2) should return -1 on
|
||||
|
@ -7,5 +7,7 @@
|
||||
# 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/aliases
|
||||
|
||||
! false
|
||||
! false -h
|
||||
|
@ -7,6 +7,8 @@
|
||||
# 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/aliases
|
||||
|
||||
intcmp -e 3 3 3
|
||||
intcmp -g 3 2 1
|
||||
intcmp -l 1 2 3
|
||||
|
20
tests/bonsai/mm.sh
Executable file
20
tests/bonsai/mm.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/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/aliases
|
||||
|
||||
exec 3>&1
|
||||
|
||||
! mm -h
|
||||
|
||||
# mm(1) will error if positional arguments are given without -i or -o
|
||||
! mm argument
|
||||
|
||||
# check if stderr is empty upon specifying -e
|
||||
! "$BIN/strcmp" "$(printf 'test\n' | mm -i - -e 2>&1 1>&3)" ''
|
@ -7,6 +7,8 @@
|
||||
# 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/aliases
|
||||
|
||||
strcmp equals equals
|
||||
! strcmp inequals equals
|
||||
strcmp - -
|
||||
|
@ -7,5 +7,7 @@
|
||||
# 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/aliases
|
||||
|
||||
true
|
||||
true -h
|
||||
|
@ -23,8 +23,6 @@ for script in tests/bonsai/*.sh; do
|
||||
export UTIL="$(printf '%s\n' "$script" \
|
||||
| sed -e 's/\.sh//g' -e 's;tests\/bonsai\/;;g')"
|
||||
|
||||
alias "$UTIL"="$BIN/$UTIL"
|
||||
|
||||
printf '%s: %s: Testing utility.\n' "$0" "$UTIL"
|
||||
"$script"
|
||||
printf '\n'
|
||||
|
Loading…
Reference in New Issue
Block a user