From 0d909187d5b9effcd08f533d50af7d29c0d6bfd8 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 8 Apr 2022 05:42:36 -0400 Subject: De-sigil-ification: $ --- stdlib/source/test/aedifex/command/auto.lux | 64 ++++---- stdlib/source/test/aedifex/command/build.lux | 204 ++++++++++++------------- stdlib/source/test/aedifex/command/install.lux | 64 ++++---- stdlib/source/test/aedifex/command/test.lux | 110 ++++++------- 4 files changed, 221 insertions(+), 221 deletions(-) (limited to 'stdlib/source/test/aedifex/command') diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux index e8d5ca1ac..1cad922f7 100644 --- a/stdlib/source/test/aedifex/command/auto.lux +++ b/stdlib/source/test/aedifex/command/auto.lux @@ -90,36 +90,36 @@ expected_runs (# ! each (|>> (n.% 10) (n.max 2)) random.nat) dummy_path (# ! each (|>> (format source /)) (random.ascii/alpha 5)) [compiler resolution] $build.resolution] - ($_ _.and - (_.cover [/.delay] - (n.> 0 /.delay)) - (in (do async.monad - [verdict (do ///action.monad - [_ (# fs make_directory source) - _ (# fs write dummy_path (binary.empty 0)) - .let [[@runs command] (..command expected_runs end_signal fs dummy_path)] - _ (# watcher poll [])] - (do [! async.monad] - [no_dangling_process! (|> profile - (has ///.#lux compiler) - ((/.do! 1 watcher command) - ($version.echo "") - (program.async (program.mock environment.empty home working_directory)) - fs - (shell.async ($build.good_shell [])) - resolution) - (# ! each (|>> (pipe.case - {try.#Failure error} - (same? end_signal error) + (all _.and + (_.cover [/.delay] + (n.> 0 /.delay)) + (in (do async.monad + [verdict (do ///action.monad + [_ (# fs make_directory source) + _ (# fs write dummy_path (binary.empty 0)) + .let [[@runs command] (..command expected_runs end_signal fs dummy_path)] + _ (# watcher poll [])] + (do [! async.monad] + [no_dangling_process! (|> profile + (has ///.#lux compiler) + ((/.do! 1 watcher command) + ($version.echo "") + (program.async (program.mock environment.empty home working_directory)) + fs + (shell.async ($build.good_shell [])) + resolution) + (# ! each (|>> (pipe.case + {try.#Failure error} + (same? end_signal error) - {try.#Success _} - false)))) - correct_number_of_runs! (|> @runs - atom.read! - async.future - (# ! each (n.= expected_runs)))] - (in {try.#Success (and correct_number_of_runs! - no_dangling_process!)})))] - (_.cover' [/.do!] - (try.else false verdict)))) - )))) + {try.#Success _} + false)))) + correct_number_of_runs! (|> @runs + atom.read! + async.future + (# ! each (n.= expected_runs)))] + (in {try.#Success (and correct_number_of_runs! + no_dangling_process!)})))] + (_.cover' [/.do!] + (try.else false verdict)))) + )))) diff --git a/stdlib/source/test/aedifex/command/build.lux b/stdlib/source/test/aedifex/command/build.lux index a7cd30b1c..86dc41f93 100644 --- a/stdlib/source/test/aedifex/command/build.lux +++ b/stdlib/source/test/aedifex/command/build.lux @@ -113,19 +113,19 @@ ///artifact.#name /.js_lux_name ///artifact.#version lux_version] ///dependency.#type ///artifact/type.js_library]]] - (`` ($_ random.either - (in js_compiler) - (~~ (template [] - [(in [///dependency.#artifact [///artifact.#group /.lux_group - ///artifact.#name - ///artifact.#version lux_version] - ///dependency.#type ///artifact/type.lux_library])] + (`` (all random.either + (in js_compiler) + (~~ (template [] + [(in [///dependency.#artifact [///artifact.#group /.lux_group + ///artifact.#name + ///artifact.#version lux_version] + ///dependency.#type ///artifact/type.lux_library])] - [/.jvm_lux_name] - [/.python_lux_name] - [/.lua_lux_name] - [/.ruby_lux_name] - )))))) + [/.jvm_lux_name] + [/.python_lux_name] + [/.lua_lux_name] + [/.ruby_lux_name] + )))))) (def: .public resolution (Random [Dependency Resolution]) @@ -158,96 +158,96 @@ profile (|> empty_profile with_program with_target)]] - ($_ _.and - (in (do async.monad - [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty home working_directory)) fs shell ///dependency/resolution.empty - (with_target empty_profile))] - (_.cover' [/.no_specified_program] - (case outcome - {try.#Success _} - false + (all _.and + (in (do async.monad + [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty home working_directory)) fs shell ///dependency/resolution.empty + (with_target empty_profile))] + (_.cover' [/.no_specified_program] + (case outcome + {try.#Success _} + false - {try.#Failure error} - (exception.match? /.no_specified_program error))))) - (in (do async.monad - [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty home working_directory)) fs shell ///dependency/resolution.empty profile)] - (_.cover' [/.Lux /.no_available_lux] - (case outcome - {try.#Success _} - false + {try.#Failure error} + (exception.match? /.no_specified_program error))))) + (in (do async.monad + [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty home working_directory)) fs shell ///dependency/resolution.empty profile)] + (_.cover' [/.Lux /.no_available_lux] + (case outcome + {try.#Success _} + false - {try.#Failure error} - (exception.match? /.no_available_lux error))))) - (do ! - [.let [console (@version.echo "")] - [compiler resolution] ..resolution] - (in (do async.monad - [verdict (do ///action.monad - [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) - fs shell resolution - (has ///.#lux compiler profile)) - start (# console read_line []) - end (# console read_line [])] - (in (and (text#= /.start start) - (text#= /.success end))))] - (_.cover' [/.do! - /.lux_group - /.jvm_lux_name - /.js_lux_name - /.python_lux_name - /.lua_lux_name - /.ruby_lux_name - /.start - /.success] - (try.else false verdict))))) - (do ! - [.let [console (@version.echo "")] - [compiler resolution] ..resolution] - (in (do async.monad - [verdict (do ///action.monad - [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) - fs (shell.async (..bad_shell [])) resolution - (has ///.#lux compiler profile)) - start (# console read_line []) - end (# console read_line [])] - (in (and (text#= /.start start) - (text#= /.failure end))))] - (_.cover' [/.failure] - (try.else false verdict))))) - (do ! - [expected/0 (random.ascii/alpha 5) - expected/1 (random.ascii/alpha 5) - expected/2 (random.ascii/alpha 5)] - (`` ($_ _.and - (~~ (template [ ] - [(let [console (@version.echo "") - shell (|> (list expected/0 expected/1 expected/2) - (..reader_shell ) - shell.async)] - (in (do [! async.monad] - [verdict (do ///action.monad - [process (shell [environment.empty working_directory "" (list "")]) - _ ( console process) - actual/0 (# console read_line []) - actual/1 (# console read_line []) - actual/2 (# console read_line []) - end! (|> (# console read_line []) - (# ! each (|>> (pipe.case - {try.#Failure error} - true - - {try.#Success _} - false) - {try.#Success})))] - (in (and (text#= expected/0 actual/0) - (text#= expected/1 actual/1) - (text#= expected/2 actual/2) - end!)))] - (_.cover' [] - (try.else false verdict)))))] + {try.#Failure error} + (exception.match? /.no_available_lux error))))) + (do ! + [.let [console (@version.echo "")] + [compiler resolution] ..resolution] + (in (do async.monad + [verdict (do ///action.monad + [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) + fs shell resolution + (has ///.#lux compiler profile)) + start (# console read_line []) + end (# console read_line [])] + (in (and (text#= /.start start) + (text#= /.success end))))] + (_.cover' [/.do! + /.lux_group + /.jvm_lux_name + /.js_lux_name + /.python_lux_name + /.lua_lux_name + /.ruby_lux_name + /.start + /.success] + (try.else false verdict))))) + (do ! + [.let [console (@version.echo "")] + [compiler resolution] ..resolution] + (in (do async.monad + [verdict (do ///action.monad + [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) + fs (shell.async (..bad_shell [])) resolution + (has ///.#lux compiler profile)) + start (# console read_line []) + end (# console read_line [])] + (in (and (text#= /.start start) + (text#= /.failure end))))] + (_.cover' [/.failure] + (try.else false verdict))))) + (do ! + [expected/0 (random.ascii/alpha 5) + expected/1 (random.ascii/alpha 5) + expected/2 (random.ascii/alpha 5)] + (`` (all _.and + (~~ (template [ ] + [(let [console (@version.echo "") + shell (|> (list expected/0 expected/1 expected/2) + (..reader_shell ) + shell.async)] + (in (do [! async.monad] + [verdict (do ///action.monad + [process (shell [environment.empty working_directory "" (list "")]) + _ ( console process) + actual/0 (# console read_line []) + actual/1 (# console read_line []) + actual/2 (# console read_line []) + end! (|> (# console read_line []) + (# ! each (|>> (pipe.case + {try.#Failure error} + true + + {try.#Success _} + false) + {try.#Success})))] + (in (and (text#= expected/0 actual/0) + (text#= expected/1 actual/1) + (text#= expected/2 actual/2) + end!)))] + (_.cover' [] + (try.else false verdict)))))] - [#0 /.log_output!] - [#1 /.log_error!] - )) - ))) - )))) + [#0 /.log_output!] + [#1 /.log_error!] + )) + ))) + )))) diff --git a/stdlib/source/test/aedifex/command/install.lux b/stdlib/source/test/aedifex/command/install.lux index 414d104d8..d4244bfcf 100644 --- a/stdlib/source/test/aedifex/command/install.lux +++ b/stdlib/source/test/aedifex/command/install.lux @@ -70,36 +70,36 @@ home (random.ascii/alpha 5) working_directory (random.ascii/alpha 5) .let [/ (# file.default separator)]] - ($_ _.and - (in (do [! async.monad] - [.let [fs (file.mock /) - program (program.async (program.mock environment.empty home working_directory)) + (all _.and + (in (do [! async.monad] + [.let [fs (file.mock /) + program (program.async (program.mock environment.empty home working_directory)) - artifact_path (///local.uri (the ///artifact.#version identity) identity) - library_path (format artifact_path ///artifact/extension.lux_library) - pom_path (format artifact_path ///artifact/extension.pom)] - verdict (do [! ///action.monad] - [succeeded! (# ! each (text#= /.success) - (..execute! program fs sample)) - library_exists! (|> library_path - (format home /) - (# fs file?) - (# async.monad each (|>> {try.#Success}))) - pom_exists! (|> pom_path - (format home /) - (# fs file?) - (# async.monad each (|>> {try.#Success})))] - (in (and succeeded! - library_exists! - pom_exists!)))] - (_.cover' [/.do! /.success] - (try.else false verdict)))) - (in (do [! async.monad] - [.let [fs (file.mock /) - program (program.async (program.mock environment.empty home working_directory))] - logging (..execute! program fs (has ///.#identity {.#None} sample))] - (_.cover' [/.failure] - (|> logging - (try#each (text#= /.failure)) - (try.else false))))) - )))) + artifact_path (///local.uri (the ///artifact.#version identity) identity) + library_path (format artifact_path ///artifact/extension.lux_library) + pom_path (format artifact_path ///artifact/extension.pom)] + verdict (do [! ///action.monad] + [succeeded! (# ! each (text#= /.success) + (..execute! program fs sample)) + library_exists! (|> library_path + (format home /) + (# fs file?) + (# async.monad each (|>> {try.#Success}))) + pom_exists! (|> pom_path + (format home /) + (# fs file?) + (# async.monad each (|>> {try.#Success})))] + (in (and succeeded! + library_exists! + pom_exists!)))] + (_.cover' [/.do! /.success] + (try.else false verdict)))) + (in (do [! async.monad] + [.let [fs (file.mock /) + program (program.async (program.mock environment.empty home working_directory))] + logging (..execute! program fs (has ///.#identity {.#None} sample))] + (_.cover' [/.failure] + (|> logging + (try#each (text#= /.failure)) + (try.else false))))) + )))) diff --git a/stdlib/source/test/aedifex/command/test.lux b/stdlib/source/test/aedifex/command/test.lux index 4109c99ee..34bd05c36 100644 --- a/stdlib/source/test/aedifex/command/test.lux +++ b/stdlib/source/test/aedifex/command/test.lux @@ -58,58 +58,58 @@ with_test with_target)] [compiler resolution] @build.resolution] - ($_ _.and - (let [fs (file.mock (# file.default separator)) - console (@version.echo "")] - (in (do async.monad - [verdict (do ///action.monad - [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) - fs (shell.async (@build.good_shell [])) resolution - (has ///.#lux compiler profile)) - build_start (# console read_line []) - build_end (# console read_line []) - test_start (# console read_line []) - test_end (# console read_line [])] - (in (and (and (text#= //build.start build_start) - (text#= //build.success build_end)) - (and (text#= /.start test_start) - (text#= /.success test_end)))))] - (_.cover' [/.do! - /.start /.success] - (try.else false verdict))))) - (let [fs (file.mock (# file.default separator)) - console (@version.echo "")] - (in (do async.monad - [verdict (do ///action.monad - [.let [bad_shell (shell.mock - (function (_ [actual_environment actual_working_directory actual_command actual_arguments]) - {try.#Success - (is (shell.Mock []) - (implementation - (def: (on_read state) - (exception.except shell.no_more_output [])) - (def: (on_fail state) - (exception.except shell.no_more_output [])) - (def: (on_write input state) - {try.#Failure "on_write"}) - (def: (on_destroy state) - {try.#Failure "on_destroy"}) - (def: (on_await state) - {try.#Success [state (if (list.any? (text#= "build") actual_arguments) - shell.normal - shell.error)]})))}) - [])] - _ (/.do! console (program.async (program.mock environment.empty home working_directory)) - fs (shell.async bad_shell) resolution - (has ///.#lux compiler profile)) - build_start (# console read_line []) - build_end (# console read_line []) - test_start (# console read_line []) - test_end (# console read_line [])] - (in (and (and (text#= //build.start build_start) - (text#= //build.success build_end)) - (and (text#= /.start test_start) - (text#= /.failure test_end)))))] - (_.cover' [/.failure] - (try.else false verdict))))) - )))) + (all _.and + (let [fs (file.mock (# file.default separator)) + console (@version.echo "")] + (in (do async.monad + [verdict (do ///action.monad + [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) + fs (shell.async (@build.good_shell [])) resolution + (has ///.#lux compiler profile)) + build_start (# console read_line []) + build_end (# console read_line []) + test_start (# console read_line []) + test_end (# console read_line [])] + (in (and (and (text#= //build.start build_start) + (text#= //build.success build_end)) + (and (text#= /.start test_start) + (text#= /.success test_end)))))] + (_.cover' [/.do! + /.start /.success] + (try.else false verdict))))) + (let [fs (file.mock (# file.default separator)) + console (@version.echo "")] + (in (do async.monad + [verdict (do ///action.monad + [.let [bad_shell (shell.mock + (function (_ [actual_environment actual_working_directory actual_command actual_arguments]) + {try.#Success + (is (shell.Mock []) + (implementation + (def: (on_read state) + (exception.except shell.no_more_output [])) + (def: (on_fail state) + (exception.except shell.no_more_output [])) + (def: (on_write input state) + {try.#Failure "on_write"}) + (def: (on_destroy state) + {try.#Failure "on_destroy"}) + (def: (on_await state) + {try.#Success [state (if (list.any? (text#= "build") actual_arguments) + shell.normal + shell.error)]})))}) + [])] + _ (/.do! console (program.async (program.mock environment.empty home working_directory)) + fs (shell.async bad_shell) resolution + (has ///.#lux compiler profile)) + build_start (# console read_line []) + build_end (# console read_line []) + test_start (# console read_line []) + test_end (# console read_line [])] + (in (and (and (text#= //build.start build_start) + (text#= //build.success build_end)) + (and (text#= /.start test_start) + (text#= /.failure test_end)))))] + (_.cover' [/.failure] + (try.else false verdict))))) + )))) -- cgit v1.2.3