From 519c0c0c71cdf7ce3dfc64b9781ab826760b3d94 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 14 Jun 2021 18:33:54 -0400 Subject: Extracted Licentia out of the standard library. --- stdlib/source/test/aedifex/command.lux | 32 ++++++++++++++++++++++++++ stdlib/source/test/aedifex/command/install.lux | 20 ++++++++-------- stdlib/source/test/aedifex/command/pom.lux | 5 ++-- stdlib/source/test/aedifex/command/version.lux | 4 +++- 4 files changed, 47 insertions(+), 14 deletions(-) create mode 100644 stdlib/source/test/aedifex/command.lux (limited to 'stdlib/source/test/aedifex') diff --git a/stdlib/source/test/aedifex/command.lux b/stdlib/source/test/aedifex/command.lux new file mode 100644 index 000000000..0ef18f044 --- /dev/null +++ b/stdlib/source/test/aedifex/command.lux @@ -0,0 +1,32 @@ +(.module: + [lux #* + ["_" test (#+ Test)]] + ["." / #_ + ["#." clean] + ["#." install] + ["#." pom] + ["#." version]] + {#program + ["." / + ## ["#." deploy] + ## ["#." deps] + ## ["#." build] + ## ["#." test] + ## ["#." auto] + ]}) + +(def: #export test + Test + (<| (_.covering /._) + (_.for [/.Command]) + ($_ _.and + /clean.test + /install.test + /pom.test + /version.test + ## /deploy.test + ## /deps.test + ## /build.test + ## /test.test + ## /auto.test + ))) diff --git a/stdlib/source/test/aedifex/command/install.lux b/stdlib/source/test/aedifex/command/install.lux index ce3f21de8..33ee7192d 100644 --- a/stdlib/source/test/aedifex/command/install.lux +++ b/stdlib/source/test/aedifex/command/install.lux @@ -16,8 +16,7 @@ ["." maybe] ["." binary] ["." text ("#\." equivalence) - ["%" format (#+ format)] - ["." encoding]] + ["%" format (#+ format)]] [format ["." xml]] [collection @@ -67,13 +66,11 @@ (def: (execute! program fs sample) (-> (Program Promise) (file.System Promise) ///.Profile (Promise (Try Text))) - (do promise.monad - [home (\ program home [])] - (do ///action.monad - [#let [console (@version.echo "")] - _ (..make_sources! fs (get@ #///.sources sample)) - _ (/.do! console fs (///repository/local.repository program fs) sample)] - (!.use (\ console read_line) [])))) + (do ///action.monad + [#let [console (@version.echo "")] + _ (..make_sources! fs (get@ #///.sources sample)) + _ (/.do! console fs (///repository/local.repository program fs) sample)] + (!.use (\ console read_line) []))) (def: #export test Test @@ -91,17 +88,18 @@ verdict (do ///action.monad [logging (..execute! program fs sample) #let [/ uri.separator - artifact_path (format (///local.uri identity) / (///artifact.identity identity)) + artifact_path (///local.uri (get@ #///artifact.version identity) identity) library_path (format artifact_path ///artifact/extension.lux_library) pom_path (format artifact_path ///artifact/extension.pom)] + #let [succeeded! (text\= //clean.success logging)] library_exists! (\ promise.monad map exception.return (file.file_exists? promise.monad fs library_path)) pom_exists! (\ promise.monad map exception.return (file.file_exists? promise.monad fs pom_path))] - (wrap (and (text\= //clean.success logging) + (wrap (and succeeded! library_exists! pom_exists!)))] (_.cover' [/.do!] diff --git a/stdlib/source/test/aedifex/command/pom.lux b/stdlib/source/test/aedifex/command/pom.lux index 33c102926..c368d5f84 100644 --- a/stdlib/source/test/aedifex/command/pom.lux +++ b/stdlib/source/test/aedifex/command/pom.lux @@ -12,7 +12,8 @@ [data ["." binary] ["." text ("#\." equivalence) - ["." encoding]] + [encoding + ["." utf8]]] [format ["." xml]]] [math @@ -46,7 +47,7 @@ (do ! [verdict (do ///action.monad [expected (|> (///pom.write sample) - (try\map (|>> (\ xml.codec encode) (\ encoding.utf8 encode))) + (try\map (|>> (\ xml.codec encode) (\ utf8.codec encode))) (\ ! wrap)) file (: (Promise (Try (File Promise))) (file.get_file promise.monad fs path)) diff --git a/stdlib/source/test/aedifex/command/version.lux b/stdlib/source/test/aedifex/command/version.lux index ee26b3b5d..c7a9aa4ef 100644 --- a/stdlib/source/test/aedifex/command/version.lux +++ b/stdlib/source/test/aedifex/command/version.lux @@ -60,7 +60,9 @@ (def: #export echo (-> Text (Console Promise)) - (|>> [true] (console.mock ..simulation))) + (|>> [true] + (console.mock ..simulation) + console.async)) (def: #export test Test -- cgit v1.2.3