aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex
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
parent86df87512966e8038d70624ab654262ce14a915c (diff)
A bit more clarity for Licentia licenses.
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/aedifex/command/auto.lux13
-rw-r--r--stdlib/source/test/aedifex/profile.lux6
-rw-r--r--stdlib/source/test/aedifex/runtime.lux51
3 files changed, 54 insertions, 16 deletions
diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux
index dfb4dc672..193a5b8d8 100644
--- a/stdlib/source/test/aedifex/command/auto.lux
+++ b/stdlib/source/test/aedifex/command/auto.lux
@@ -27,7 +27,7 @@
["." instant]]
[world
[console (#+ Console)]
- ["." shell (#+ Shell)]
+ ["." shell (#+ Exit Shell)]
["." program (#+ Program)]
["." file
["." watch]]]]
@@ -46,7 +46,7 @@
(def: (command expected_runs end_signal fs dummy_file)
(-> Nat Text (file.System Promise) file.Path
[(Atom Nat)
- (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command Any))])
+ (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command [Exit Any]))])
(let [@runs (: (Atom Nat)
(atom.atom 0))]
[@runs
@@ -56,10 +56,11 @@
(if (n.= expected_runs actual_runs)
(wrap (#try.Failure end_signal))
(do (try.with !)
- [_ (\ fs write (\ utf8.codec encode (%.nat actual_runs)) dummy_file)]
- (\ fs modify
- (|> actual_runs .int instant.from_millis)
- dummy_file)))))]))
+ [_ (\ fs write (\ utf8.codec encode (%.nat actual_runs)) dummy_file)
+ _ (\ fs modify
+ (|> actual_runs .int instant.from_millis)
+ dummy_file)]
+ (wrap [shell.normal []])))))]))
(def: #export test
Test
diff --git a/stdlib/source/test/aedifex/profile.lux b/stdlib/source/test/aedifex/profile.lux
index d4cbb958a..e7e3f50ac 100644
--- a/stdlib/source/test/aedifex/profile.lux
+++ b/stdlib/source/test/aedifex/profile.lux
@@ -27,6 +27,7 @@
[\\program
["." /
["/#" // #_
+ ["#." runtime]
["#." dependency (#+ Dependency)]
["#." format]
[repository
@@ -129,6 +130,11 @@
(random.maybe (random.ascii/alpha 1))
(random.maybe (random.ascii/alpha 1))
(..dictionary_of text.hash (random.ascii/alpha 1) ..repository)
+ (random\wrap //runtime.default_java)
+ (random\wrap //runtime.default_js)
+ (random\wrap //runtime.default_python)
+ (random\wrap //runtime.default_lua)
+ (random\wrap //runtime.default_ruby)
))
(def: #export test
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)))))
)))))