Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 6627e22274
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (28 sloc) 0.847 kB
(use arc equal-wrt-testing)
(def test-iso (desc result expected)
(if (equal-wrt-testing expected result)
(do (pr "ok " desc " => ")
(write result)
(prn))
(do (pr "FAIL " desc " => ")
(write result)
(pr ", not the expected result ")
(write expected)
(prn)
(err "test failed"))))
(mac catcherr body
`(on-err idfn (fn () ,@body)))
(def makeerr (msg)
(catcherr (err msg)))
(mac testis (expr expected)
`(test-iso (tostring (write ',expr)) (catcherr ,expr) ,expected))
(mac cleandir (var dir . body)
`(let ,var ,dir
(system (+ "rm -rf " ,var))
(system (+ "mkdir " ,var))
,@body))
(mac w/testdir body
`(cleandir testdir (+ "/tmp/" (uniq))
,@body))
(mac w/foofile body
`(w/testdir (let foofile (+ testdir "/foo") ,@body)))
Jump to Line
Something went wrong with that request. Please try again.