~subsetpark/ec

069d4dd0405c0a5b21ea2904c62206e3fbb1fa21 — Zach Smith 11 months ago 338eebe
Bugfix argument ordering
2 files changed, 11 insertions(+), 3 deletions(-)

M src/calc.janet
M test/regressions.janet
M src/calc.janet => src/calc.janet +2 -3
@@ 58,7 58,6 @@
            (map (partial inner-apply op) ;(map |($ :data) args)))
      (let [f (op :fun-ref)
            unwrapped (map |($ :value) args)]

        (->> (f ;unwrapped)
             (make-element))))))



@@ 107,8 106,8 @@

    (def buf @[])
    (loop [_ :range [0 arity]]
      (array/push buf (pop self)))

      (array/insert buf 0 (pop self)))
    
    (->> (apply-operation op ;buf)
         (make-element)
         (push self))))

M test/regressions.janet => test/regressions.janet +9 -0
@@ 33,4 33,13 @@
  (def res (calc/pop s))
  (vec= [18 19] res))

(deftest regression3
  # [2 3 4] 1 -
  (def s (:new calc/Stack))
  (let [in (parser/parse "[2 3 4] 1 -")]
    (calc/push-all s in))
  
  (def res (calc/pop s))
  (vec= [1 2 3] res))

(run-tests!)