aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/metadata.lux
blob: 20c67f929ec2faa7473dbeb7d3cae93f05bed063 (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
50
51
(.using
 [library
  [lux "*"
   ["_" test {"+" Test}]
   [abstract
    [monad {"+" do}]]
   [data
    ["[0]" text ("[1]#[0]" equivalence)]]
   [math
    ["[0]" random]]]]
 ["[0]" / "_"
  ["[1][0]" artifact]
  ["[1][0]" snapshot]
  [//
   ["$[0]" artifact]]]
 [\\program
  ["[0]" /]])

(def: .public test
  Test
  (<| (_.covering /._)
      (all _.and
           (do random.monad
             [sample $artifact.random]
             (all _.and
                  (_.coverage [/.remote_artifact_uri /.remote_project_uri]
                    (not (text#= (/.remote_artifact_uri sample)
                                 (/.remote_project_uri sample))))
                  (_.coverage [/.local_uri]
                    (let [remote_artifact_uri (/.remote_artifact_uri sample)
                          remote_project_uri (/.remote_project_uri sample)]
                      (and (not (text#= remote_artifact_uri (/.local_uri remote_artifact_uri)))
                           (not (text#= remote_project_uri (/.local_uri remote_project_uri))))))
                  (_.coverage [/.remote_uri]
                    (let [remote_artifact_uri (/.remote_artifact_uri sample)
                          remote_project_uri (/.remote_project_uri sample)]
                      (and (text#= remote_artifact_uri (/.remote_uri remote_artifact_uri))
                           (text#= remote_project_uri (/.remote_uri remote_project_uri))
                           (|> remote_artifact_uri
                               /.local_uri
                               /.remote_uri
                               (text#= remote_artifact_uri))
                           (|> remote_project_uri
                               /.local_uri
                               /.remote_uri
                               (text#= remote_project_uri)))))
                  ))
           
           /artifact.test
           /snapshot.test
           )))