general increase/decrease testing funcs
parent
55e4da77c5
commit
021c2301c5
|
@ -45,6 +45,37 @@ function expect_change {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function expect_increase {
|
||||||
|
read -r out
|
||||||
|
comp=$1
|
||||||
|
desc=$2
|
||||||
|
expected=1
|
||||||
|
res=$(echo "$out>$comp" | bc)
|
||||||
|
if [[ $res = $expected ]]; then
|
||||||
|
log_ok
|
||||||
|
echo $desc correctly increased
|
||||||
|
else
|
||||||
|
log_fail
|
||||||
|
echo $desc did not increase ($out should be greater than $comp)
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function expect_decrease {
|
||||||
|
read -r out
|
||||||
|
comp=$1
|
||||||
|
desc=$2
|
||||||
|
expected=1
|
||||||
|
res=$(echo "$out<$comp" | bc)
|
||||||
|
if [[ $res = $expected ]]; then
|
||||||
|
log_ok
|
||||||
|
echo $desc correctly decreased
|
||||||
|
else
|
||||||
|
log_fail
|
||||||
|
echo $desc did not decrease ($out should be less than than $comp)
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Get balance of an account.
|
# Get balance of an account.
|
||||||
function get_balance {
|
function get_balance {
|
||||||
|
|
Loading…
Reference in New Issue