mirror of
https://github.com/kanaka/mal.git
synced 2024-09-11 13:55:55 +03:00
step5 test: group related test code together.
This commit is contained in:
parent
d4423670fe
commit
953772ca00
@ -12,14 +12,6 @@ res2
|
||||
;=>50005000
|
||||
|
||||
|
||||
;; Test recursive non-tail call function
|
||||
|
||||
(def! sum-to (fn* (n) (if (= n 0) 0 (+ n (sum-to (- n 1))))))
|
||||
|
||||
(sum-to 10)
|
||||
;=>55
|
||||
|
||||
|
||||
;; Test mutually recursive tail-call functions
|
||||
|
||||
(def! foo (fn* (n) (if (= n 0) 0 (bar (- n 1)))))
|
||||
@ -29,6 +21,13 @@ res2
|
||||
;=>0
|
||||
|
||||
|
||||
;; Test recursive non-tail call function
|
||||
|
||||
(def! sum-to (fn* (n) (if (= n 0) 0 (+ n (sum-to (- n 1))))))
|
||||
|
||||
(sum-to 10)
|
||||
;=>55
|
||||
|
||||
;;; no try* yet, so test completion of side-effects
|
||||
(def! res1 nil)
|
||||
;=>nil
|
||||
|
Loading…
Reference in New Issue
Block a user