Skip to content
Newer
Older
100644 32 lines (25 sloc) 784 Bytes
54985ef @awwx add in more dependencies
awwx authored Jun 4, 2011
1 (use arc equal-wrt-testing)
2
df96c30 @awwx remove more dead code from test.arc
awwx authored Jun 8, 2011
3 (def test-iso (desc result expected)
c2dd011 @awwx .
awwx authored Jan 8, 2011
4 (if (equal-wrt-testing expected result)
df96c30 @awwx remove more dead code from test.arc
awwx authored Jun 8, 2011
5 (do (pr "ok " desc " => ")
6 (write result)
7 (prn))
c2dd011 @awwx .
awwx authored Jan 8, 2011
8 (do (pr "FAIL " desc " => ")
9 (write result)
10 (pr ", not the expected result ")
11 (write expected)
12 (prn)
13 (err "test failed"))))
14
15 (mac catcherr body
16 `(on-err idfn (fn () ,@body)))
17
18 (def makeerr (msg)
19 (catcherr (err msg)))
20
21 (mac testis (expr expected)
22 `(test-iso (tostring (write ',expr)) (catcherr ,expr) ,expected))
23
9f55834 @awwx replace hardcoded test directory with w/testdir
awwx authored Jun 8, 2011
24 (mac w/testdir body
25 `(let testdir (+ "/tmp/" (uniq))
26 (system (+ "rm -rf " testdir))
27 (system (+ "mkdir " testdir))
28 ,@body))
672b89b @awwx fix dir
awwx authored Jun 1, 2011
29
9f55834 @awwx replace hardcoded test directory with w/testdir
awwx authored Jun 8, 2011
30 (mac w/foofile body
31 `(w/testdir (let foofile (+ testdir "/foo") ,@body)))
Something went wrong with that request. Please try again.