From d77b8410640b3b6279999a064945c5c8c1d54a05 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 27 Jun 2020 17:49:00 -0700 Subject: [PATCH] Add new failing test case: Non-player can terminate judging The code that is intending to check whether all answering players have completed judging is currently broken. It is only checking whether the number of players that have judged is as large as the number of players that have answered. This is the wrong logic in the case where a player who didn't answer joins the game late and submits judging results, which is exactly what we do in the new test case here. This test case currently fails, so a fix of the bug described above will cause it to start passing. --- test | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test b/test index fcb556c..646cdca 100755 --- a/test +++ b/test @@ -856,6 +856,16 @@ result=$(echo $(empathy_scores alice)) test "$result" = "null" TEST_END +TEST "Submit word groups from a non-answering player" +result=$(empathy_judged dale $prompt_id '[]') +test "$result" = '{"valid":true}' +TEST_END + +TEST "Scoring still hasn't started" +result=$(echo $(empathy_scores alice)) +test "$result" = "null" +TEST_END + TEST "Submit word groups from last answering player" result=$(empathy_judged charlie $prompt_id '[]') test "$result" = '{"valid":true}' -- 2.43.0