From 699f0ad23aca21076edb6a51838d879ca580ffd5 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Sat, 28 Feb 2015 10:38:17 -0600 Subject: Add long running perf test. --- tests/perf3.mal | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/perf3.mal (limited to 'tests') diff --git a/tests/perf3.mal b/tests/perf3.mal new file mode 100644 index 0000000..be66239 --- /dev/null +++ b/tests/perf3.mal @@ -0,0 +1,28 @@ +(load-file "../core.mal") +(load-file "../perf.mal") + +;;(prn "Start: basic macros/atom test") + +(def! atm (atom (list 0 1 2 3 4 5 6 7 8 9))) + +(println "iters/s:" + (run-fn-for + (fn* [] + (do + (or false nil false nil false nil false nil false nil (first @atm)) + (cond false 1 nil 2 false 3 nil 4 false 5 nil 6 "else" (first @atm)) + (-> (deref atm) rest rest rest rest rest rest first) + (swap! atm (fn* [a] (concat (rest a) (list (first a))))))) + 10)) + +;;(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))))))) +;; +;;(println "iters/s:" +;; (run-fn-for +;; (fn* [] +;; (do +;; (sumdown 10) +;; (fib 12))) +;; 3)) +;;(prn "Done: basic macros/atom test") -- cgit v1.2.3 From 90ab31710e9a495ba3aebf7948e366093896d6d7 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Sat, 28 Feb 2015 11:18:18 -0600 Subject: JS: fix https://github.com/kanaka/mal/issues/9 --- tests/step2_eval.mal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/step2_eval.mal b/tests/step2_eval.mal index aaf1a7d..e975910 100644 --- a/tests/step2_eval.mal +++ b/tests/step2_eval.mal @@ -11,8 +11,8 @@ (/ (- (+ 5 (* 2 3)) 3) 4) ;=>2 -(/ (- (+ 515 (* 222 311)) 300) 41) -;=>1689 +(/ (- (+ 515 (* 222 311)) 302) 27) +;=>2565 (abc 1 2 3) ; .*\'abc\' not found.* -- cgit v1.2.3