aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-04-17 21:49:07 -0500
committerJoel Martin <github@martintribe.org>2014-04-17 21:49:07 -0500
commitdb4c329aff4621e05b92a55be4f18173f5a4f655 (patch)
tree92baaa6d88246e509cfd6a7d03d8fab997e0b935 /tests
parent8cb5cda46cf3aef847ae3926dc53a5e5f87fe261 (diff)
downloadmal-db4c329aff4621e05b92a55be4f18173f5a4f655.tar.gz
mal-db4c329aff4621e05b92a55be4f18173f5a4f655.zip
All: perf test, Makefile refactor, add *host-language*
Other: - bash,make,postscript: quasiquote of vectors - Fix Java slurp - add time function to core.mal - switches on *host-language* for make time-secs vs time-ms - Ignore */experiments directories
Diffstat (limited to 'tests')
-rw-r--r--tests/perf1.mal10
-rw-r--r--tests/perf2.mal12
-rw-r--r--tests/step7_quote.mal6
3 files changed, 28 insertions, 0 deletions
diff --git a/tests/perf1.mal b/tests/perf1.mal
new file mode 100644
index 0000000..871e28f
--- /dev/null
+++ b/tests/perf1.mal
@@ -0,0 +1,10 @@
+(load-file "../core.mal")
+
+;;(prn "Start: basic macros performance test")
+
+(time (do
+ (or false nil false nil false nil false nil false nil 4)
+ (cond false 1 nil 2 false 3 nil 4 false 5 nil 6 "else" 7)
+ (-> (list 1 2 3 4 5 6 7 8 9) rest rest rest rest rest rest first)))
+
+;;(prn "Done: basic macros performance test")
diff --git a/tests/perf2.mal b/tests/perf2.mal
new file mode 100644
index 0000000..3889191
--- /dev/null
+++ b/tests/perf2.mal
@@ -0,0 +1,12 @@
+(load-file "../core.mal")
+
+;;(prn "Start: basic math/recursion test")
+
+(def! sumdown (fn* (N) (if (> N 0) (+ N (sumdown (- N 1))) 0)))
+(def! fib (fn* (N) (if (= N 0) 1 (if (= N 1) 1 (+ (fib (- N 1)) (fib (- N 2)))))))
+
+(time (do
+ (sumdown 10)
+ (fib 12)))
+
+;;(prn "Done: basic math/recursion test")
diff --git a/tests/step7_quote.mal b/tests/step7_quote.mal
index c41c7e2..9166065 100644
--- a/tests/step7_quote.mal
+++ b/tests/step7_quote.mal
@@ -47,6 +47,9 @@
;=>(1 b 3)
`(1 ~b 3)
;=>(1 (1 "b" "d") 3)
+;;; TODO: fix this
+;;;`[1 ~b 3]
+;;;;=>[1 (1 "b" "d") 3]
;; Testing splice-unquote
@@ -56,6 +59,9 @@
;=>(1 c 3)
`(1 ~@c 3)
;=>(1 1 "b" "d" 3)
+;;; TODO: fix this
+;;;`[1 ~@c 3]
+;;;;=>[1 1 "b" "d" 3]
;; Testing symbol equality