aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/metadata.lux
blob: 5ff5988ee80882dc7dc74f3d237d950589264530 (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
                  (_.cover [/.remote_artifact_uri /.remote_project_uri]
                           (not (text#= (/.remote_artifact_uri sample)
                                        (/.remote_project_uri sample))))
                  (_.cover [/.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))))))
                  (_.cover [/.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
           )))