From abea9915939bd7f5b6e70f12d724f19dc6694ec9 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 11 Jun 2020 19:49:12 -0700 Subject: [PATCH] test: Expand empathy test case to include mixed capitalization When actually playing a live game recently, we noticed it normalized different capitalization when sending words out to be judged, but didn't normalize it when scoring. So we add a test case for this. It currently fails here, (showing the bug). When the bug is fixed this test should start passing without needing any change to the test itself. --- test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test b/test index d419fc1..7113659 100755 --- a/test +++ b/test @@ -498,7 +498,7 @@ empathy_answer() TEST_SUBSECTION "Submitting answers" TEST "Submit from a non-player fails" -result=$(empathy_answer bogus $prompt_id '"sun", "sand", "water", "people"') +result=$(empathy_answer bogus $prompt_id '"Sun", "Sand", "Water", "People"') test "$result" = '{"valid":false,"message":"Player not found"}' TEST_END @@ -508,12 +508,12 @@ test "$result" = '{"valid":true}' TEST_END TEST "Submit from bob succeeds" -result=$(empathy_answer $bob $prompt_id '"sand", "sands", "sunlight", "towels"') +result=$(empathy_answer $bob $prompt_id '"sand", "sands", "SunLight", "towels"') test "$result" = '{"valid":true}' TEST_END TEST "Submit from charlie succeeds" -result=$(empathy_answer $charlie $prompt_id '"sunshine", "grains of sand", "wafer", "people"') +result=$(empathy_answer $charlie $prompt_id '"SunShine", "Grains of Sand", "wafer", "people"') test "$result" = '{"valid":true}' TEST_END @@ -533,7 +533,7 @@ empathy_ambiguities() TEST "Received all unique words" # echo here is to strip newlines result=$(echo $(empathy_ambiguities $alice)) -test "$result" = '"sun" "sand" "water" "people" "sands" "sunlight" "towels" "sunshine" "grains of sand" "wafer"' +test "$result" = '"sun" "sand" "water" "people" "sands" "SunLight" "towels" "SunShine" "Grains of Sand" "wafer"' TEST_END TEST "Submit word groups from alice" -- 2.43.0