From e510279e4114b1ad53c8fd1beb956c7a2b74c0fd Mon Sep 17 00:00:00 2001 From: Juho Hautala Date: Sun, 10 Dec 2017 19:10:51 +0200 Subject: [PATCH] Additional test for `straight?` The tests for `straight?` pass when the implementation checks for a strictly monotonic sequence: ```clojure (defn straight? [hand] (apply < (sort (map rank hand)))) ``` These changes add a test case to not pass such an implementation. --- src/iloveponies/tests/p_p_p_pokerface.clj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/iloveponies/tests/p_p_p_pokerface.clj b/src/iloveponies/tests/p_p_p_pokerface.clj index b1fded6..d614565 100644 --- a/src/iloveponies/tests/p_p_p_pokerface.clj +++ b/src/iloveponies/tests/p_p_p_pokerface.clj @@ -84,6 +84,7 @@ low-ace-straight-hand true ["2H" "2D" "3H" "4H" "5H"] false ["2H" "3H" "3D" "4H" "6H"] false + ["2H" "3H" "4D" "5H" "7H"] false high-ace-straight-hand true) (facts "straight-flush?" {:exercise 10