]> git.cworth.org Git - empires-server/commitdiff
test: Expand empathy test case to include mixed capitalization
authorCarl Worth <cworth@cworth.org>
Fri, 12 Jun 2020 02:49:12 +0000 (19:49 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 12 Jun 2020 02:49:12 +0000 (19:49 -0700)
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

diff --git a/test b/test
index d419fc139556983923914cdea908022bc470eebc..7113659eb5d40f2c7fadb3572ec53eed5f2b8dd9 100755 (executable)
--- 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"