Skip to content

Instantly share code, notes, and snippets.

@jennifersmith
Created December 10, 2011 22:32
Show Gist options
  • Save jennifersmith/1456771 to your computer and use it in GitHub Desktop.
Save jennifersmith/1456771 to your computer and use it in GitHub Desktop.
Really really basic test runner :)
(defmacro check [ code expected]
`(if (= ~code ~expected)
(do
(println "Success: " '~code " does indeed equal " ~expected ) true )
(do
(println "FAIL: " '~code " does not sadly equal " ~expected ) false )))
(check (+ 4 1) 4) ;; FAIL: (+ 4 1) does not sadly equal 4
(check (range 4) 4) ;; Success: (range 4) does indeed equal [0 1 2 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment