aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/runtime.lux
blob: 0143eaac85490a4afe26471dbb323088129a7d22 (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
(.module:
  [lux #*
   ["_" test (#+ Test)]
   [abstract
    [monad (#+ do)]]
   [data
    ["." text]]
   [math
    ["." random]]]
  {#program
   ["." /]})

(def: #export test
  Test
  (<| (_.covering /._)
      (do random.monad
        [path (random.ascii/alpha 5)]
        (`` ($_ _.and
                (~~ (template [<command>]
                      [(_.cover [<command>]
                                (let [command (text.join_with " " (#.Cons (<command> path)))
                                      pure_command (text.join_with " " (#.Cons (<command> "")))]
                                  (and (text.starts_with? pure_command command)
                                       (text.ends_with? path command))))]

                      [/.java]
                      [/.node]
                      ))
                )))))