mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-05-18 21:31:29 +08:00
[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:
committed by
Jordan Harband
parent
d200a21559
commit
20d52b6419
@@ -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"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user