Skip to content

Instantly share code, notes, and snippets.

@gtrak
Created February 5, 2012 02:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gtrak/1742220 to your computer and use it in GitHub Desktop.
Save gtrak/1742220 to your computer and use it in GitHub Desktop.
(ns splinter.test.core
(:use splinter.core
clojure.test
clojure.repl
clojure.java.io))
(def PREFIX "testsuite/")
(defn test-fn [infile]
(let [a (str PREFIX infile ".ttl")
;b (slurp (resource a))
]
(println a)
a))
(defmacro create-test
"pass in nil for out-file if the test is expected to fail"
[test-file out-file]
`(deftest ~(symbol test-file)
(is true (= (test-fn ~test-file) (if ~out-file (slurp (resource (str ~PREFIX ~out-file))))))))
;;; bad test cases, no output expected
(defmacro create-tests []
(doseq [t
["bad-00"
"bad-01"
"bad-02"
"bad-03"
"bad-04"
"bad-05"
"bad-06"
"bad-07"
"bad-08"
"bad-09"
"bad-10"
"bad-11"
"bad-12"
"bad-13"
"bad-14"]]
(print t)
(create-test t nil)))
(create-tests)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment