~subsetpark/ec

ref: c3bd46baec9f52d7598c609d8a7a91571bfe3412 ec/test/compose.janet -rw-r--r-- 406 bytes
c3bd46ba — Zach Smith Update dependencies 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(import /src/calc)
(import /src/parser)
(import /src/env)

(import /src/operations :prefix "o/")
(import /src/adverbs :prefix "a/")

(use testament)
(use /test-support)

(deftest dip
  (let [s (env/new-env)
        in (parser/parse "2 3 4 (+) dip")]
    (eval-all s in)
    (let [four (calc/pop s)
          five (calc/pop s)]
      (is (= 4 (four :value)))
      (is (= 5 (five :value))))))

(run-tests!)