~technomancy/fennel

fd04d078c938eeaa41004ee58874eeacd56439cd — Mitsuhiro Nakamura 2 months ago e79b7e0
Add more tests for the accumulation macro
1 files changed, 11 insertions(+), 0 deletions(-)

M test/loops.fnl
M test/loops.fnl => test/loops.fnl +11 -0
@@ 36,6 36,17 @@
      [24 58 1999]))

(fn test-accum []
  (== "(var x true)
       (let [y (accum [state :init
                       _ _ (pairs {})]
                 (do (set x false)
                     :update))]
         [x y])"
      [true :init])
  (== "(accum [s :fen
               _ c (ipairs [:n :e :l :o]) :until (>= c :o)]
         (.. s c))"
      "fennel")
  (== "(accum [n 0
               _ _ (pairs {:one 1 :two nil :three 3})]
         (+ n 1))"