Count the number of expressions executed in do

This commit is contained in:
Nicolas Dandrimont 2013-04-04 11:20:10 +02:00
parent 06511fe303
commit ba021ed7bf

View File

@ -85,6 +85,17 @@
(assert (= 1 1)) (assert (= 1 1))
(assert (= 1 1))))) (assert (= 1 1)))))
(defn test-branching-expr-count-with-do []
"NATIVE: make sure we execute the right number of expressions in the branch"
(setv counter 0)
(if false
(assert (= 2 1))
(do
(setv counter (+ counter 1))
(setv counter (+ counter 1))
(setv counter (+ counter 1))))
(assert (= counter 3)))
(defn test-cond [] (defn test-cond []
"NATIVE: test if cond sorta works." "NATIVE: test if cond sorta works."