aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/macro/syntax.lux
blob: ae4c66db02b8cdcca0f9efe06235e73ffb939ab8 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
(.using
 [library
  [lux "*"
   ["_" test (.only Test)]
   [abstract
    [monad (.only do)]]
   [control
    [parser
     ["<[0]>" code]]]
   [math
    ["[0]" random]
    [number
     ["n" nat]]]]]
 [\\library
  ["[0]" /]]
 ["[0]" / "_"
  ["[1][0]" check]
  ["[1][0]" declaration]
  ["[1][0]" definition]
  ["[1][0]" export]
  ["[1][0]" input]
  ["[1][0]" type "_"
   ["[1]/[0]" variable]]])

(/.syntax: (+/3 [a <code>.any
                 b <code>.any
                 c <code>.any])
  (in (list (` (all n.+ (~ a) (~ b) (~ c))))))

(def: .public test
  Test
  (<| (_.covering /._)
      (all _.and
           (do random.monad
             [x random.nat
              y random.nat
              z random.nat]
             (_.coverage [/.syntax:]
               (n.= (all n.+ x y z)
                    (+/3 x y z)))) 

           /check.test
           /declaration.test
           /definition.test
           /export.test
           /input.test
           /type/variable.test
           )))