Make signatures of response functions match

Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit is contained in:
Sebastian Crane 2022-02-09 14:20:06 +00:00
parent 977ab9ea3a
commit ac1a8d9c94
2 changed files with 8 additions and 8 deletions

View File

@ -13,13 +13,13 @@
(game/get-players-of-game state)
(sort)))
(defn match-string [state game]
(defn match-string [state game _]
(str "Anyone ready for "
game
"? "
(str/join " " (sorted-players-of-game state game))))
(defn list-players-string [state game]
(defn list-players-string [state game _]
(let [players (str/join (map #(str " _" % "_")
(sorted-players-of-game state game)))]
(str "Players of "
@ -27,14 +27,14 @@
":"
players)))
(defn add-player-string [player game]
(defn add-player-string [_ game player]
(str "Added "
player
" to the list of players for "
game
"!"))
(defn remove-player-string [player game]
(defn remove-player-string [_ game player]
(str "Removed "
player
" from the list of players for "

View File

@ -11,16 +11,16 @@
(deftest match-string-test
(is (= '"Anyone ready for quasi-Rts? 123 abc"
(match-string test-state "quasi-Rts"))))
(match-string test-state "quasi-Rts" nil))))
(deftest list-players-string-test
(is (= "Players of HYPOTHETICAL-shooter: _123_ _abc_ _xyz_"
(list-players-string test-state "HYPOTHETICAL-shooter"))))
(list-players-string test-state "HYPOTHETICAL-shooter" nil))))
(deftest add-player-string-test
(is (= "Added abc to the list of players for Quasi-Rts!"
(add-player-string "abc" "Quasi-Rts"))))
(add-player-string nil "Quasi-Rts" "abc"))))
(deftest remove-player-string-test
(is (= "Removed abc from the list of players for hypothetical-shooter!"
(remove-player-string "abc" "hypothetical-shooter"))))
(remove-player-string nil "hypothetical-shooter" "abc"))))