aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/data/product.lux
blob: 5e28aaf5ea862f2a30750a04c14d454f7fa8739b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(.module:
  [lux #*
   ["_" test (#+ Test)]
   data/text/format]
  {1
   ["." /]})

(def: #export test
  Test
  (<| (_.context (%name (name-of .&)))
      ($_ _.and
          (_.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))))
          )))