aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/runtime.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-07-12 22:51:25 -0400
committerEduardo Julian2021-07-12 22:51:25 -0400
commit86bcfadb774618defaa27bbb9361a93d288fb985 (patch)
tree48c8422b872ec21d60810a88e47f38c9583f6333 /stdlib/source/test/aedifex/runtime.lux
parent86df87512966e8038d70624ab654262ce14a915c (diff)
A bit more clarity for Licentia licenses.
Diffstat (limited to 'stdlib/source/test/aedifex/runtime.lux')
-rw-r--r--stdlib/source/test/aedifex/runtime.lux51
1 files changed, 41 insertions, 10 deletions
diff --git a/stdlib/source/test/aedifex/runtime.lux b/stdlib/source/test/aedifex/runtime.lux
index 968e753f8..e75a9297e 100644
--- a/stdlib/source/test/aedifex/runtime.lux
+++ b/stdlib/source/test/aedifex/runtime.lux
@@ -4,26 +4,57 @@
[abstract
[monad (#+ do)]]
[data
- ["." text]]
+ ["." maybe ("#\." functor)]
+ ["." text ("#\." equivalence)]
+ [collection
+ ["." list ("#\." functor)]
+ ["." set]]]
[math
- ["." random]]]
+ ["." random (#+ Random) ("#\." monad)]
+ [number
+ ["n" nat]]]]
[\\program
["." /]])
+(def: #export random
+ (Random /.Runtime)
+ ($_ random.either
+ (random\wrap /.default_java)
+ (random\wrap /.default_js)
+ (random\wrap /.default_python)
+ (random\wrap /.default_lua)
+ (random\wrap /.default_ruby)
+ ))
+
(def: #export test
Test
(<| (_.covering /._)
+ (_.for [/.Runtime])
(do random.monad
- [path (random.ascii/alpha 5)]
+ [path (random.ascii/alpha 5)
+ runtime ..random]
(`` ($_ _.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))))]
+ [(_.cover [/.default_java /.default_js /.default_python /.default_lua /.default_ruby]
+ (let [listing (|> (list /.default_java /.default_js /.default_python /.default_lua /.default_ruby)
+ (list\map (get@ #/.program)))
+ unique (set.from_list text.hash listing)]
+ (n.= (list.size listing)
+ (set.size unique))))]
- [/.java]
- [/.node]
+ [/.default_java]
+ [/.default_js]
+ [/.default_python]
+ [/.default_lua]
+ [/.default_ruby]
))
+ (_.cover [/.for]
+ (let [runtime' (/.for runtime path)]
+ (and (text\= (get@ #/.program runtime)
+ (get@ #/.program runtime'))
+ (|> runtime'
+ (get@ #/.parameters)
+ list.last
+ (maybe\map (text\= path))
+ (maybe.default false)))))
)))))