mirror of
https://github.com/denisidoro/navi
synced 2024-11-22 19:43:06 +00:00
2753e84ea6
This reverts commit 9848d7b39a
.
35 lines
529 B
Bash
35 lines
529 B
Bash
#!/usr/bin/env bash
|
|
|
|
source "${SCRIPT_DIR}/src/main.sh"
|
|
|
|
PASSED=0
|
|
FAILED=0
|
|
|
|
test::success() {
|
|
PASSED=$((PASSED+1))
|
|
echo "Test passed!"
|
|
}
|
|
|
|
test::fail() {
|
|
FAILED=$((FAILED+1))
|
|
echo "Test failed..."
|
|
return
|
|
}
|
|
|
|
test::run() {
|
|
echo
|
|
echo "-> $1"
|
|
shift
|
|
eval "$*" && test::success || test::fail
|
|
}
|
|
|
|
test::finish() {
|
|
echo
|
|
if [ $FAILED -gt 0 ]; then
|
|
echo "${PASSED} tests passed but ${FAILED} failed... :("
|
|
exit "${FAILED}"
|
|
else
|
|
echo "All ${PASSED} tests passed! :)"
|
|
exit 0
|
|
fi
|
|
}
|