aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test/test/lux/data/product.lux
blob: 309e8e311c560ea8e845f583a283553efa8f1082 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(.module:
  lux
  (lux (data ["@" product]))
  lux/test)

(context: "Products"
  ($_ seq
      (test "Can access the sides of a pair."
            (and (i/= 1 (@.left [1 2]))
                 (i/= 2 (@.right [1 2]))))
      
      (test "Can swap the sides of a pair."
            (let [[_left _right] (@.swap [1 2])]
              (and (i/= 2 _left)
                   (i/= 1 _right))))
      ))