diff options
author | Eduardo Julian | 2020-10-25 05:10:08 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-10-25 05:10:08 -0400 |
commit | 72b4eecdc514387ab3b1c105cfd49436c9eb1e8d (patch) | |
tree | 20d8e52d5769b00be003dea58754b5bea79bb9e3 /stdlib/source/test/aedifex | |
parent | e153b011bb94ba95474505c307873616bb493b6d (diff) |
Some improvements to the Lux syntax parser.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/aedifex.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/input.lux | 51 |
2 files changed, 53 insertions, 0 deletions
diff --git a/stdlib/source/test/aedifex.lux b/stdlib/source/test/aedifex.lux index 50d194e43..fd92d9b40 100644 --- a/stdlib/source/test/aedifex.lux +++ b/stdlib/source/test/aedifex.lux @@ -7,6 +7,7 @@ [cli (#+ program:)]]]] ["." / #_ ["#." artifact] + ["#." input] ["#." command #_ ["#/." pom]] ["#." dependency] @@ -21,6 +22,7 @@ Test ($_ _.and /artifact.test + /input.test /command/pom.test /dependency.test /profile.test diff --git a/stdlib/source/test/aedifex/input.lux b/stdlib/source/test/aedifex/input.lux new file mode 100644 index 000000000..39a71eb81 --- /dev/null +++ b/stdlib/source/test/aedifex/input.lux @@ -0,0 +1,51 @@ +(.module: + [lux #* + ["_" test (#+ Test)] + [abstract + [monad (#+ do)]] + [control + ["." try (#+ Try) ("#@." functor)] + [concurrency + ["." promise (#+ Promise)]] + [security + ["!" capability]]] + [data + ["." binary] + ["." text ("#@." equivalence) + ["%" format] + ["." encoding]]] + [math + ["." random (#+ Random)]] + [world + ["." file (#+ File)]]] + [// + ["@." profile]] + {#program + ["." / + ["/#" // #_ + ["#" profile (#+ Profile)] + ["#." project] + ["#." action] + ["#." format]]]}) + +(def: #export test + Test + (<| (_.covering /._) + (do {@ random.monad} + [expected (:: @ map (set@ #//.parents (list)) @profile.random) + #let [fs (: (file.System Promise) + (file.mock (:: file.system separator)))]] + (wrap (do promise.monad + [verdict (do //action.monad + [file (: (Promise (Try (File Promise))) + (file.get-file promise.monad fs //project.file)) + _ (|> expected + //format.profile + %.code + encoding.to-utf8 + (!.use (:: file over-write))) + actual (: (Promise (Try Profile)) + (/.read promise.monad fs //.default))] + (wrap (:: //.equivalence = expected actual)))] + (_.claim [/.read] + (try.default false verdict))))))) |