aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/function/method.lux
blob: 3e3ec7a84fe250694aecc980600251a78a2e0f54 (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
... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

(.require
 [library
  [lux (.except)
   [abstract
    [monad (.only do)]]
   [math
    ["[0]" random (.only Random)]]
   [meta
    [compiler
     [target
      [jvm
       ["[0]" modifier (.only Modifier)]
       ["[0]" method (.only Method)]]]]]
   [test
    ["_" property (.only Test)]]]]
 [\\library
  ["[0]" /]]
 ["[0]" /
  ["[1][0]" implementation]
  ["[1][0]" reset]])

(def (valid_modifier? it)
  (-> (Modifier Method)
      Bit)
  (and (modifier.has? method.public it)
       (modifier.has? method.strict it)))

(def .public test
  Test
  (<| (_.covering /._)
      (do [! random.monad]
        [])
      (all _.and
           (_.coverage [/.modifier]
             (and (modifier.has? method.public /.modifier)
                  (modifier.has? method.strict /.modifier)))

           (/implementation.test valid_modifier?)
           /reset.test
           )))