mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-11-22 00:53:56 +03:00
20 lines
371 B
Bash
20 lines
371 B
Bash
assert_ok() {
|
|
local FUNCTION=$1
|
|
shift
|
|
|
|
$($FUNCTION $@) || die '"'"$FUNCTION $@"'" should have succeeded, but failed'
|
|
}
|
|
|
|
assert_not_ok() {
|
|
local FUNCTION=$1
|
|
shift
|
|
|
|
! $($FUNCTION $@) || die '"'"$FUNCTION $@"'" should have failed, but succeeded'
|
|
}
|
|
|
|
strip_colors() {
|
|
while read -r line; do
|
|
echo "$line" | LC_ALL=C command sed 's/\[[ -?]*[@-~]//g'
|
|
done
|
|
}
|