From b9061b44194c6564364ee41dfda17df171547cf4 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 24 Jan 2021 14:56:02 -0300 Subject: tests: Add logs of which test is running --- tests/ranking.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'tests/ranking.sh') 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 -- cgit v1.2.3