aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/ffi/export.py.lux
blob: a0d5dcf1691031302982c54debab151bc3932d8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(.using
 [library
  [lux (.except)
   ["_" test (.only Test)]
   ["[0]" static]
   [math
    [number
     ["n" nat]]]]]
 [\\library
  ["[0]" / (.only)
   ["/[1]" //]]])

(with_expansions [<nat> (static.random_nat)]
  (/.export
    (def constant
      Nat
      <nat>)
    (def shift
      (-> Nat Nat)
      (|>> (n.+ <nat>))))

  (//.import (constant Nat))
  (//.import (shift (-> Nat Nat)))

  (def .public test
    Test
    (<| (_.covering /._)
        (all _.and
             (_.coverage [/.export]
               (and (n.= <nat> ..constant)
                    (n.= (n.+ <nat> <nat>) (..shift <nat>))))
             )))
  )