File: do.hy

package info (click to toggle)
hy 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,632 kB
  • sloc: python: 7,299; makefile: 38; sh: 27
file content (12 lines) | stat: -rw-r--r-- 248 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
(defn test-empty []
  (assert (is (do) None))
  (assert (is (if True (do) (do)) None)))


(defn test-nonempty []
  (assert (= (do 1 2 3) 3))
  (assert (= (do 3 2 1) 1))

  (setv x "a")
  (assert (= (do (setv x "b") "c") "c"))
  (assert (= x "b")))