aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/meta/macro/syntax.lux
blob: 5c6b392f15dd354dff17033430b262e2d61be086 (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
49
(.require
 [library
  [lux (.except)
   ["_" test (.only Test)]
   [abstract
    [monad (.only do)]]
   [math
    ["[0]" random]
    [number
     ["n" nat]]]
   [meta
    ["[0]" code
     ["<[1]>" \\parser]]]]]
 [\\library
  ["[0]" /]]
 ["[0]" /
  ["[1][0]" check]
  ["[1][0]" declaration]
  ["[1][0]" definition]
  ["[1][0]" export]
  ["[1][0]" input]
  ["[1][0]" type
   ["[1]/[0]" variable]]])

(def +/3
  (/.syntax (_ [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
           )))