Last active
May 13, 2020 19:06
-
-
Save tstout/0507ea8755b849924580e6d4e9130168 to your computer and use it in GitHub Desktop.
inline-tests #clojure
This file contains hidden or 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
| (defn divisble? | |
| "Is `n` divisble by `d`?" | |
| {:test (fn [] | |
| (is (divisble? 49 7)) | |
| (is (not (divisble? 48 7))) | |
| (is (divisble? 5 0)))} | |
| [n d] | |
| (zero? (try (mod n d) | |
| (catch Exception _ 0)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment