[tests] remove double-substitution in assert_ok and assert_not_ok

Co-authored-by: Андрій Шовкошитний <198119344+enlightened88@users.noreply.github.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
This commit is contained in:
Андрій Шовкошитний
2026-04-23 17:16:32 +03:00
committed by Jordan Harband
parent d200a21559
commit 20d52b6419
4 changed files with 59 additions and 3 deletions

View File

@@ -28,14 +28,14 @@ assert_ok() {
local FUNCTION=$1
shift
$($FUNCTION $@) || die '"'"$FUNCTION $@"'" should have succeeded, but failed'
"$FUNCTION" "$@" || die '"'"$FUNCTION $@"'" should have succeeded, but failed'
}
assert_not_ok() {
local FUNCTION=$1
shift
! $($FUNCTION $@) || die '"'"$FUNCTION $@"'" should have failed, but succeeded'
! "$FUNCTION" "$@" || die '"'"$FUNCTION $@"'" should have failed, but succeeded'
}
strip_colors() {
@@ -46,7 +46,7 @@ strip_colors() {
make_echo() {
echo "#!/bin/sh" > "$1"
echo "echo \"${2}\"" > "$1"
echo "echo \"${2}\"" >> "$1"
chmod a+x "$1"
}