aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/metadata.lux
blob: bdac5dfac82849c3064d31d96f9b27f3fc5c00ff (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 (.except)
   ["_" test (.only Test)]
   [abstract
    [monad (.only do)]]
   [data
    ["[0]" text (.open: "[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
           )))