aboutsummaryrefslogtreecommitdiff
path: root/tests/ranking.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-01-24 14:56:02 -0300
committerEuAndreh <eu@euandre.org>2021-01-24 14:56:02 -0300
commitb9061b44194c6564364ee41dfda17df171547cf4 (patch)
tree7f1c15858005b4f827f879e52b3d3ad5f9cc7fa6 /tests/ranking.sh
parentremembering: Append to in-memory string instead of intermediate file (diff)
downloadremembering-b9061b44194c6564364ee41dfda17df171547cf4.tar.gz
remembering-b9061b44194c6564364ee41dfda17df171547cf4.tar.xz
tests: Add logs of which test is running
Diffstat (limited to '')
-rwxr-xr-xtests/ranking.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/ranking.sh b/tests/ranking.sh
index 5dec051..e01692e 100755
--- a/tests/ranking.sh
+++ b/tests/ranking.sh
@@ -4,6 +4,7 @@ set -eu
. tests/lib.sh
test_picking_first_makes_it_be_always_first() {
+ testing 'picking first makes it be always first'
OUT="$(mktemp)"
ERR="$(mktemp)"
PROFILE="always-picks-first-$(uuid)"
@@ -18,6 +19,7 @@ test_picking_first_makes_it_be_always_first() {
assert_empty_stderr
assert_stdout 'always-picked'
done
+ test_ok
}
INPUT='a
@@ -71,6 +73,7 @@ assert_first() {
}
test_promoting_values() {
+ testing 'promoting values'
PROFILE="promoting-$(uuid)"
pick_x h
@@ -80,9 +83,11 @@ test_promoting_values() {
pick_x h
pick_x z
assert_first h
+ test_ok
}
test_higher_values_loose_tie() {
+ testing 'higher values loose tie'
PROFILE="higher-loose-tie-$(uuid)"
pick_x f
@@ -91,9 +96,11 @@ test_higher_values_loose_tie() {
pick_x g
pick_x z
assert_first f
+ test_ok
}
test_smaller_values_win_tie() {
+ testing 'smaller values win tie'
PROFILE="smaller-win-tie-$(uuid)"
pick_x d
@@ -102,9 +109,11 @@ test_smaller_values_win_tie() {
pick_x c
pick_x z
assert_first c
+ test_ok
}
test_many_sequential_picks() {
+ testing 'many sequential pick'
PROFILE="many-sequential-picks-$(uuid)"
pick_x b
@@ -139,11 +148,13 @@ m
s'
ACTUAL="$(head -n9 "$ERR")"
if [ "$ACTUAL" != "$EXPECTED" ]; then
- printf 'Bad order!\n\nexpected: %s\ngot: %s\n' \
+ printf '\nERR: Bad order!\n\nexpected: %s\ngot: %s\n' \
"$(echo "$EXPECTED" | tr '\n' ' ')" \
- "$(echo "$ACTUAL" | tr '\n' ' ')"
+ "$(echo "$ACTUAL" | tr '\n' ' ')" \
+ >&2
exit 1
fi
+ test_ok
}
test_picking_first_makes_it_be_always_first