Created
February 5, 2012 02:57
-
-
Save gtrak/1742220 to your computer and use it in GitHub Desktop.
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
(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