/test.cljs Secret
Created
May 26, 2021 13:37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def test-script-2 [[:start 0 0 0] [:move 10] [:turn 90] [:move 20]]) | |
(def my-test-steps | |
[[:coords [0 0]] | |
[:coords [10 0]] | |
[:angle 1337] | |
[:coords [0 20]]]) | |
(defn test-at-steps [script all-tests] | |
(loop [[[getter correct] & tests] all-tests | |
turtle (turtle/turtle-at-start script)] | |
(when-not (turtle/reached-end? turtle script) | |
(is (= correct (getter turtle))) | |
(recur tests (turtle/step-turtle turtle script))))) | |
(deftest more-tests | |
(testing "test-at-steps-3" | |
(test-at-steps test-script-2 my-test-steps))) | |
; FAIL in (more-tests) (kilppari/core_test.cljs:44:11) | |
; "test-at-steps-3" | |
; expected: (= | |
; correct | |
; (getter turtle)) | |
; actual: (= | |
; 1337 | |
; 90) | |
; diff: - 1337 | |
; + 90 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment