aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/local.lux
blob: 1c713684ca195f53d3d78d807ece35a1e90fc510 (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
(.module:
  [lux #*
   ["_" test (#+ Test)]
   [abstract
    [monad (#+ do)]]
   [control
    [concurrency
     [promise (#+ Promise)]]]
   [data
    ["." text]]
   [math
    ["." random (#+ Random)]]
   [world
    ["." file]]]
  [//
   ["@." artifact]]
  {#program
   ["." /
    ["/#" // #_
     ["#." artifact]]]})

(def: #export test
  Test
  (<| (_.covering /._)
      (do {! random.monad}
        [sample @artifact.random
         #let [fs (: (file.System Promise)
                     (file.mock (:: file.default separator)))]]
        ($_ _.and
            (_.cover [/.repository /.path]
                     (let [path (/.path fs sample)]
                       (and (text.starts-with? (/.repository fs)
                                               path)
                            (text.ends-with? (//artifact.path fs sample)
                                             path))))
            ))))