Skip to content

Instantly share code, notes, and snippets.

@tstout
Last active May 13, 2020 19:06
Show Gist options
  • Select an option

  • Save tstout/0507ea8755b849924580e6d4e9130168 to your computer and use it in GitHub Desktop.

Select an option

Save tstout/0507ea8755b849924580e6d4e9130168 to your computer and use it in GitHub Desktop.
inline-tests #clojure
(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