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

(def: .public test
  Test
  (<| (_.covering /._)
      ($_ _.and
          (do random.monad
            [sample $artifact.random]
            ($_ _.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
          )))