From 86bcfadb774618defaa27bbb9361a93d288fb985 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 12 Jul 2021 22:51:25 -0400 Subject: A bit more clarity for Licentia licenses. --- stdlib/source/test/aedifex/runtime.lux | 51 +++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 10 deletions(-) (limited to 'stdlib/source/test/aedifex/runtime.lux') 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 [] - [(_.cover [] - (let [command (text.join_with " " (#.Cons ( path))) - pure_command (text.join_with " " (#.Cons ( "")))] - (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))))) ))))) -- cgit v1.2.3