From 4ca397765805eda5ddee393901ed3a02001a960a Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 25 Dec 2020 09:22:38 -0400 Subject: Replaced kebab-case with snake_case for naming convention. --- stdlib/source/test/aedifex/artifact.lux | 2 +- stdlib/source/test/aedifex/artifact/extension.lux | 10 +- stdlib/source/test/aedifex/artifact/type.lux | 10 +- stdlib/source/test/aedifex/cache.lux | 50 ++--- stdlib/source/test/aedifex/command/auto.lux | 56 ++--- stdlib/source/test/aedifex/command/build.lux | 118 +++++----- stdlib/source/test/aedifex/command/clean.lux | 86 +++---- stdlib/source/test/aedifex/command/deploy.lux | 68 +++--- stdlib/source/test/aedifex/command/deps.lux | 54 ++--- stdlib/source/test/aedifex/command/install.lux | 38 ++-- stdlib/source/test/aedifex/command/pom.lux | 12 +- stdlib/source/test/aedifex/command/test.lux | 74 +++--- stdlib/source/test/aedifex/command/version.lux | 26 +-- .../source/test/aedifex/dependency/resolution.lux | 250 ++++++++++----------- stdlib/source/test/aedifex/hash.lux | 16 +- stdlib/source/test/aedifex/input.lux | 10 +- stdlib/source/test/aedifex/local.lux | 4 +- stdlib/source/test/aedifex/metadata.lux | 4 +- stdlib/source/test/aedifex/metadata/artifact.lux | 10 +- stdlib/source/test/aedifex/metadata/snapshot.lux | 18 +- stdlib/source/test/aedifex/package.lux | 6 +- stdlib/source/test/aedifex/parser.lux | 32 +-- stdlib/source/test/aedifex/pom.lux | 2 +- stdlib/source/test/aedifex/profile.lux | 30 +-- stdlib/source/test/aedifex/project.lux | 54 ++--- stdlib/source/test/aedifex/repository.lux | 8 +- stdlib/source/test/aedifex/runtime.lux | 4 +- 27 files changed, 526 insertions(+), 526 deletions(-) (limited to 'stdlib/source/test/aedifex') diff --git a/stdlib/source/test/aedifex/artifact.lux b/stdlib/source/test/aedifex/artifact.lux index a718d51f6..fc8bb2dae 100644 --- a/stdlib/source/test/aedifex/artifact.lux +++ b/stdlib/source/test/aedifex/artifact.lux @@ -46,7 +46,7 @@ (file.mock (\ file.default separator)))]] (_.cover [/.uri /.path] (|> (/.path fs sample) - (text.replace-all uri.separator (\ fs separator)) + (text.replace_all uri.separator (\ fs separator)) (text\= (/.uri sample))))) /type.test diff --git a/stdlib/source/test/aedifex/artifact/extension.lux b/stdlib/source/test/aedifex/artifact/extension.lux index cd695ae93..2a3f3f564 100644 --- a/stdlib/source/test/aedifex/artifact/extension.lux +++ b/stdlib/source/test/aedifex/artifact/extension.lux @@ -22,10 +22,10 @@ (<| (_.covering /._) (_.for [/.Extension] ($_ _.and - (_.cover [/.lux-library /.jvm-library /.pom + (_.cover [/.lux_library /.jvm_library /.pom /.sha-1 /.md5] - (let [options (list /.lux-library /.jvm-library /.pom /.sha-1 /.md5) - uniques (set.from-list text.hash options)] + (let [options (list /.lux_library /.jvm_library /.pom /.sha-1 /.md5) + uniques (set.from_list text.hash options)] (n.= (list.size options) (set.size uniques)))) (_.cover [/.extension] @@ -33,8 +33,8 @@ [(text\= (/.extension ))] - [//.lux-library /.lux-library] - [//.jvm-library /.jvm-library] + [//.lux_library /.lux_library] + [//.jvm_library /.jvm_library] [//.pom /.pom] ))))) )))) diff --git a/stdlib/source/test/aedifex/artifact/type.lux b/stdlib/source/test/aedifex/artifact/type.lux index 5dc1b9caa..7f153b2a9 100644 --- a/stdlib/source/test/aedifex/artifact/type.lux +++ b/stdlib/source/test/aedifex/artifact/type.lux @@ -19,8 +19,8 @@ (Random /.Type) ($_ random.either ($_ random.either - (random\wrap /.lux-library) - (random\wrap /.jvm-library)) + (random\wrap /.lux_library) + (random\wrap /.jvm_library)) ($_ random.either (random\wrap /.pom) (random\wrap /.md5) @@ -32,11 +32,11 @@ (<| (_.covering /._) (_.for [/.Type] ($_ _.and - (_.cover [/.lux-library /.jvm-library + (_.cover [/.lux_library /.jvm_library /.pom /.md5 /.sha-1] - (let [options (list /.lux-library /.jvm-library + (let [options (list /.lux_library /.jvm_library /.pom /.md5 /.sha-1) - uniques (set.from-list text.hash options)] + uniques (set.from_list text.hash options)] (n.= (list.size options) (set.size uniques)))) )))) diff --git a/stdlib/source/test/aedifex/cache.lux b/stdlib/source/test/aedifex/cache.lux index 0bb0aea68..c4c2d044f 100644 --- a/stdlib/source/test/aedifex/cache.lux +++ b/stdlib/source/test/aedifex/cache.lux @@ -45,24 +45,24 @@ (def: type (Random Type) ($_ random.either - (random\wrap //artifact/type.lux-library) - (random\wrap //artifact/type.jvm-library))) + (random\wrap //artifact/type.lux_library) + (random\wrap //artifact/type.jvm_library))) (def: profile (Random [Artifact Profile XML]) (random.one (function (_ profile) - (try.to-maybe + (try.to_maybe (do try.monad [pom (//pom.write profile) - identity (try.from-maybe (get@ #//.identity profile))] + identity (try.from_maybe (get@ #//.identity profile))] (wrap [identity profile pom])))) @profile.random)) (def: content (Random Binary) (do {! random.monad} - [content-size (\ ! map (n.% 100) random.nat)] - (_binary.random content-size))) + [content_size (\ ! map (n.% 100) random.nat)] + (_binary.random content_size))) (def: package (Random [Dependency Package]) @@ -77,9 +77,9 @@ (def: resolution (Random Resolution) (do {! random.monad} - [[main-dependency main-package] ..package - dependencies (|> (//package.dependencies main-package) - (\ try.monad map set.to-list) + [[main_dependency main_package] ..package + dependencies (|> (//package.dependencies main_package) + (\ try.monad map set.to_list) (try.default (list)) (monad.map ! (function (_ dependency) (do ! @@ -88,47 +88,47 @@ (set@ #//.dependencies (set.new //dependency.hash)) (set@ #//.identity (#.Some (get@ #//dependency.artifact dependency))) //pom.write - try.to-maybe)) + try.to_maybe)) ..profile) content ..content] (wrap [dependency (set@ #//package.origin #//package.Remote (//package.local pom content))])))))] - (wrap (dictionary.from-list //dependency.hash (list& [main-dependency main-package] dependencies))))) + (wrap (dictionary.from_list //dependency.hash (list& [main_dependency main_package] dependencies))))) (def: singular Test (do {! random.monad} - [[dependency expected-package] ..package + [[dependency expected_package] ..package home (random.ascii/alpha 5) - working-directory (random.ascii/alpha 5) + working_directory (random.ascii/alpha 5) #let [fs (: (file.System Promise) (file.mock (\ file.default separator))) - program (program.async (program.mock environment.empty home working-directory))]] + program (program.async (program.mock environment.empty home working_directory))]] (wrap (do promise.monad - [wrote! (/.write-one program fs dependency expected-package) - read! (/.read-one program fs dependency)] - (_.cover' [/.write-one /.read-one] + [wrote! (/.write_one program fs dependency expected_package) + read! (/.read_one program fs dependency)] + (_.cover' [/.write_one /.read_one] (<| (try.default false) (do try.monad [_ wrote! - actual-package read!] + actual_package read!] (wrap (\ //package.equivalence = - (set@ #//package.origin #//package.Local expected-package) - actual-package))))))))) + (set@ #//package.origin #//package.Local expected_package) + actual_package))))))))) (def: plural Test (do {! random.monad} [expected ..resolution home (random.ascii/alpha 5) - working-directory (random.ascii/alpha 5) + working_directory (random.ascii/alpha 5) #let [fs (: (file.System Promise) (file.mock (\ file.default separator))) - program (program.async (program.mock environment.empty home working-directory))]] + program (program.async (program.mock environment.empty home working_directory))]] (wrap (do promise.monad - [wrote! (/.write-all program fs expected) - read! (/.read-all program fs (dictionary.keys expected) //dependency/resolution.empty)] - (_.cover' [/.write-all /.read-all] + [wrote! (/.write_all program fs expected) + read! (/.read_all program fs (dictionary.keys expected) //dependency/resolution.empty)] + (_.cover' [/.write_all /.read_all] (<| (try.default false) (do try.monad [_ wrote! diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux index c43d8642f..817b4db5f 100644 --- a/stdlib/source/test/aedifex/command/auto.lux +++ b/stdlib/source/test/aedifex/command/auto.lux @@ -47,26 +47,26 @@ ["#." dependency ["#/." resolution (#+ Resolution)]]]]]}) -(def: (command end-signal dummy-files) +(def: (command end_signal dummy_files) (-> Text (List Path) [(Atom [Nat (List Path)]) (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command Any))]) (let [@runs (: (Atom [Nat (List Path)]) - (atom.atom [0 dummy-files]))] + (atom.atom [0 dummy_files]))] [@runs (function (_ console program fs shell resolution profile) (do {! promise.monad} - [[runs remaining-files] (promise.future - (atom.update (function (_ [runs remaining-files]) - [(inc runs) remaining-files]) + [[runs remaining_files] (promise.future + (atom.update (function (_ [runs remaining_files]) + [(inc runs) remaining_files]) @runs))] - (case remaining-files + (case remaining_files #.Nil - (wrap (#try.Failure end-signal)) + (wrap (#try.Failure end_signal)) (#.Cons head tail) (do (try.with !) - [_ (!.use (\ fs create-file) [head])] + [_ (!.use (\ fs create_file) [head])] (do ! [_ (promise.future (atom.write [runs tail] @runs))] (wrap (#try.Success [])))))))])) @@ -77,47 +77,47 @@ (do {! random.monad} [#let [/ (\ file.default separator) [fs watcher] (watch.mock /)] - end-signal (random.ascii/alpha 5) + end_signal (random.ascii/alpha 5) program (random.ascii/alpha 5) target (random.ascii/alpha 5) home (random.ascii/alpha 5) - working-directory (random.ascii/alpha 5) - expected-runs (\ ! map (|>> (n.% 10) (n.max 2)) random.nat) + working_directory (random.ascii/alpha 5) + expected_runs (\ ! map (|>> (n.% 10) (n.max 2)) random.nat) source (random.ascii/alpha 5) - dummy-files (|> (random.ascii/alpha 5) - (random.set text.hash (dec expected-runs)) - (\ ! map (|>> set.to-list (list\map (|>> (format source /)))))) - #let [empty-profile (: Profile + dummy_files (|> (random.ascii/alpha 5) + (random.set text.hash (dec expected_runs)) + (\ ! map (|>> set.to_list (list\map (|>> (format source /)))))) + #let [empty_profile (: Profile (\ ///.monoid identity)) - with-target (: (-> Profile Profile) + with_target (: (-> Profile Profile) (set@ #///.target (#.Some target))) - with-program (: (-> Profile Profile) + with_program (: (-> Profile Profile) (set@ #///.program (#.Some program))) - profile (|> empty-profile - with-program - with-target - (set@ #///.sources (set.from-list text.hash (list source))))] + profile (|> empty_profile + with_program + with_target + (set@ #///.sources (set.from_list text.hash (list source))))] resolution @build.resolution] ($_ _.and (wrap (do promise.monad [verdict (do ///action.monad - [#let [[@runs command] (..command end-signal dummy-files)] - _ (!.use (\ fs create-directory) [source]) + [#let [[@runs command] (..command end_signal dummy_files)] + _ (!.use (\ fs create_directory) [source]) _ (\ watcher poll [])] (do promise.monad [outcome ((/.do! watcher command) (@version.echo "") - (program.async (program.mock environment.empty home working-directory)) + (program.async (program.mock environment.empty home working_directory)) fs - (@build.good-shell []) + (@build.good_shell []) resolution profile) - [actual-runs _] (promise.future (atom.read @runs))] - (wrap (#try.Success (and (n.= expected-runs actual-runs) + [actual_runs _] (promise.future (atom.read @runs))] + (wrap (#try.Success (and (n.= expected_runs actual_runs) (case outcome (#try.Failure error) - (is? end-signal error) + (is? end_signal error) (#try.Success _) false))))))] diff --git a/stdlib/source/test/aedifex/command/build.lux b/stdlib/source/test/aedifex/command/build.lux index 025d01c0b..8a4df9a7e 100644 --- a/stdlib/source/test/aedifex/command/build.lux +++ b/stdlib/source/test/aedifex/command/build.lux @@ -36,55 +36,55 @@ ["#." dependency ["#/." resolution]]]]}) -(def: #export good-shell +(def: #export good_shell (-> Any (Shell Promise)) (shell.mock - (function (_ [actual-environment actual-working-directory actual-command actual-arguments]) + (function (_ [actual_environment actual_working_directory actual_command actual_arguments]) (#try.Success (: (shell.Simulation []) (structure - (def: (on-read state) - (#try.Failure "on-read")) - (def: (on-error state) - (#try.Failure "on-error")) - (def: (on-write input state) - (#try.Failure "on-write")) - (def: (on-destroy state) - (#try.Failure "on-destroy")) - (def: (on-await state) + (def: (on_read state) + (#try.Failure "on_read")) + (def: (on_error state) + (#try.Failure "on_error")) + (def: (on_write input state) + (#try.Failure "on_write")) + (def: (on_destroy state) + (#try.Failure "on_destroy")) + (def: (on_await state) (#try.Success [state shell.normal])))))))) -(def: #export bad-shell +(def: #export bad_shell (-> Any (Shell Promise)) (shell.mock - (function (_ [actual-environment actual-working-directory actual-command actual-arguments]) + (function (_ [actual_environment actual_working_directory actual_command actual_arguments]) (#try.Success (: (shell.Simulation []) (structure - (def: (on-read state) - (#try.Failure "on-read")) - (def: (on-error state) - (#try.Failure "on-error")) - (def: (on-write input state) - (#try.Failure "on-write")) - (def: (on-destroy state) - (#try.Failure "on-destroy")) - (def: (on-await state) + (def: (on_read state) + (#try.Failure "on_read")) + (def: (on_error state) + (#try.Failure "on_error")) + (def: (on_write input state) + (#try.Failure "on_write")) + (def: (on_destroy state) + (#try.Failure "on_destroy")) + (def: (on_await state) (#try.Success [state shell.error])))))))) (def: compiler (do random.monad - [lux-version (random.ascii/alpha 5) - #let [jvm-compiler {#///dependency.artifact {#///artifact.group /.lux-group - #///artifact.name /.jvm-compiler-name - #///artifact.version lux-version} - #///dependency.type ///artifact/type.lux-library} - js-compiler {#///dependency.artifact {#///artifact.group /.lux-group - #///artifact.name /.js-compiler-name - #///artifact.version lux-version} - #///dependency.type ///artifact/type.lux-library}]] - (random.either (wrap jvm-compiler) - (wrap js-compiler)))) + [lux_version (random.ascii/alpha 5) + #let [jvm_compiler {#///dependency.artifact {#///artifact.group /.lux_group + #///artifact.name /.jvm_compiler_name + #///artifact.version lux_version} + #///dependency.type ///artifact/type.lux_library} + js_compiler {#///dependency.artifact {#///artifact.group /.lux_group + #///artifact.name /.js_compiler_name + #///artifact.version lux_version} + #///dependency.type ///artifact/type.lux_library}]] + (random.either (wrap jvm_compiler) + (wrap js_compiler)))) (def: #export resolution (do random.monad @@ -98,63 +98,63 @@ (<| (_.covering /._) (do {! random.monad} [#let [fs (file.mock (\ file.default separator)) - shell (..good-shell [])] + shell (..good_shell [])] program (random.ascii/alpha 5) target (random.ascii/alpha 5) home (random.ascii/alpha 5) - working-directory (random.ascii/alpha 5) - #let [empty-profile (: Profile + working_directory (random.ascii/alpha 5) + #let [empty_profile (: Profile (\ ///.monoid identity)) - with-target (: (-> Profile Profile) + with_target (: (-> Profile Profile) (set@ #///.target (#.Some target))) - with-program (: (-> Profile Profile) + with_program (: (-> Profile Profile) (set@ #///.program (#.Some program))) - profile (|> empty-profile - with-program - with-target)]] + profile (|> empty_profile + with_program + with_target)]] ($_ _.and (wrap (do promise.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] + [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))))) + (exception.match? /.no_specified_program error))))) (wrap (do promise.monad - [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty home working-directory)) fs shell ///dependency/resolution.empty - (with-program empty-profile))] - (_.cover' [/.no-specified-target] + [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty home working_directory)) fs shell ///dependency/resolution.empty + (with_program empty_profile))] + (_.cover' [/.no_specified_target] (case outcome (#try.Success _) false (#try.Failure error) - (exception.match? /.no-specified-target error))))) + (exception.match? /.no_specified_target error))))) (wrap (do promise.monad - [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty home working-directory)) fs shell ///dependency/resolution.empty profile)] - (_.cover' [/.Compiler /.no-available-compiler] + [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty home working_directory)) fs shell ///dependency/resolution.empty profile)] + (_.cover' [/.Compiler /.no_available_compiler] (case outcome (#try.Success _) false (#try.Failure error) - (exception.match? /.no-available-compiler error))))) + (exception.match? /.no_available_compiler error))))) (do ! [#let [console (@version.echo "")] resolution ..resolution] (wrap (do promise.monad [verdict (do ///action.monad - [_ (/.do! console (program.async (program.mock environment.empty home working-directory)) fs shell resolution profile) - start (!.use (\ console read-line) []) - end (!.use (\ console read-line) [])] + [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs shell resolution profile) + start (!.use (\ console read_line) []) + end (!.use (\ console read_line) [])] (wrap (and (text\= /.start start) (text\= /.success end))))] (_.cover' [/.do! - /.lux-group /.jvm-compiler-name /.js-compiler-name + /.lux_group /.jvm_compiler_name /.js_compiler_name /.start /.success] (try.default false verdict))))) (do ! @@ -162,9 +162,9 @@ resolution ..resolution] (wrap (do promise.monad [verdict (do ///action.monad - [_ (/.do! console (program.async (program.mock environment.empty home working-directory)) fs (..bad-shell []) resolution profile) - start (!.use (\ console read-line) []) - end (!.use (\ console read-line) [])] + [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs (..bad_shell []) resolution profile) + start (!.use (\ console read_line) []) + end (!.use (\ console read_line) [])] (wrap (and (text\= /.start start) (text\= /.failure end))))] (_.cover' [/.failure] diff --git a/stdlib/source/test/aedifex/command/clean.lux b/stdlib/source/test/aedifex/command/clean.lux index 739bd1a34..c429f34fb 100644 --- a/stdlib/source/test/aedifex/command/clean.lux +++ b/stdlib/source/test/aedifex/command/clean.lux @@ -37,7 +37,7 @@ ["#" profile] ["#." action (#+ Action)]]]}) -(def: node-name +(def: node_name (Random Text) (random.ascii/alpha 10)) @@ -45,58 +45,58 @@ (-> Path (Random (List [Path Binary]))) (do {! random.monad} [count (\ ! map (n.% 10) random.nat) - names (random.set text.hash count ..node-name) + names (random.set text.hash count ..node_name) contents (random.list count (_binary.random 100))] - (wrap (list.zip/2 (list\map (|>> (format prefix)) (set.to-list names)) + (wrap (list.zip/2 (list\map (|>> (format prefix)) (set.to_list names)) contents)))) -(def: (create-file! fs [path content]) +(def: (create_file! fs [path content]) (-> (file.System Promise) [Path Binary] (Promise (Try Any))) (do {! (try.with promise.monad)} [file (: (Promise (Try (File Promise))) - (file.get-file promise.monad fs path))] - (!.use (\ file over-write) content))) + (file.get_file promise.monad fs path))] + (!.use (\ file over_write) content))) -(def: (create-directory! fs path files) +(def: (create_directory! fs path files) (-> (file.System Promise) Path (List [Path Binary]) (Promise (Try Any))) (do {! (try.with promise.monad)} [_ (: (Promise (Try Path)) - (file.make-directories promise.monad fs path)) - _ (monad.map ! (..create-file! fs) files)] + (file.make_directories promise.monad fs path)) + _ (monad.map ! (..create_file! fs) files)] (wrap []))) -(def: (directory-exists? fs) +(def: (directory_exists? fs) (-> (file.System Promise) Path (Promise (Try Bit))) - (|>> (file.directory-exists? promise.monad fs) (try.lift promise.monad))) + (|>> (file.directory_exists? promise.monad fs) (try.lift promise.monad))) -(def: (file-exists? fs) +(def: (file_exists? fs) (-> (file.System Promise) Path (Promise (Try Bit))) - (|>> (file.file-exists? promise.monad fs) (try.lift promise.monad))) + (|>> (file.file_exists? promise.monad fs) (try.lift promise.monad))) -(def: (assets-exist? fs directory-path files) +(def: (assets_exist? fs directory_path files) (-> (file.System Promise) Path (List [Path Binary]) (Promise (Try Bit))) (do {! (try.with promise.monad)} - [directory-exists? (..directory-exists? fs directory-path) - files-exist? (: (Action (List Bit)) + [directory_exists? (..directory_exists? fs directory_path) + files_exist? (: (Action (List Bit)) (|> files (list\map product.left) - (monad.map ///action.monad (..file-exists? fs))))] - (wrap (and directory-exists? - (list.every? (|>>) files-exist?))))) + (monad.map ///action.monad (..file_exists? fs))))] + (wrap (and directory_exists? + (list.every? (|>>) files_exist?))))) (def: #export test Test (<| (_.covering /._) (do {! random.monad} - [context ..node-name - target ..node-name - sub ..node-name + [context ..node_name + target ..node_name + sub ..node_name #let [fs (file.mock (\ file.default separator)) / (\ fs separator) - target-path (format context / target) - sub-path (format target-path / sub)] - direct-files (..files (format target-path /)) - sub-files (..files (format sub-path /)) + target_path (format context / target) + sub_path (format target_path / sub)] + direct_files (..files (format target_path /)) + sub_files (..files (format sub_path /)) dummy @profile.random] ($_ _.and @@ -105,28 +105,28 @@ verdict (do {! (try.with promise.monad)} [_ (/.do! console fs (set@ #///.target #.None dummy))] (\ ! map (text\= /.failure) - (!.use (\ console read-line) [])))] + (!.use (\ console read_line) [])))] (_.cover' [/.failure] (try.default false verdict)))) (wrap (do promise.monad [#let [console (@version.echo "")] verdict (do {! (try.with promise.monad)} - [_ (..create-directory! fs target-path direct-files) - _ (..create-directory! fs sub-path sub-files) - context-exists!/pre (..directory-exists? fs context) - target-exists!/pre (..assets-exist? fs target-path direct-files) - sub-exists!/pre (..assets-exist? fs sub-path sub-files) - _ (/.do! console fs (set@ #///.target (#.Some target-path) dummy)) - context-exists!/post (..directory-exists? fs context) - target-exists!/post (..assets-exist? fs target-path direct-files) - sub-exists!/post (..assets-exist? fs sub-path sub-files) - logging (!.use (\ console read-line) [])] - (wrap (and (and context-exists!/pre - context-exists!/post) - (and target-exists!/pre - (not target-exists!/post)) - (and sub-exists!/pre - (not sub-exists!/post)) + [_ (..create_directory! fs target_path direct_files) + _ (..create_directory! fs sub_path sub_files) + context_exists!/pre (..directory_exists? fs context) + target_exists!/pre (..assets_exist? fs target_path direct_files) + sub_exists!/pre (..assets_exist? fs sub_path sub_files) + _ (/.do! console fs (set@ #///.target (#.Some target_path) dummy)) + context_exists!/post (..directory_exists? fs context) + target_exists!/post (..assets_exist? fs target_path direct_files) + sub_exists!/post (..assets_exist? fs sub_path sub_files) + logging (!.use (\ console read_line) [])] + (wrap (and (and context_exists!/pre + context_exists!/post) + (and target_exists!/pre + (not target_exists!/post)) + (and sub_exists!/pre + (not sub_exists!/post)) (text\= /.success logging))))] (_.cover' [/.do! /.success] (try.default false verdict)))) diff --git a/stdlib/source/test/aedifex/command/deploy.lux b/stdlib/source/test/aedifex/command/deploy.lux index 86f3e0dbb..b6cd89469 100644 --- a/stdlib/source/test/aedifex/command/deploy.lux +++ b/stdlib/source/test/aedifex/command/deploy.lux @@ -53,9 +53,9 @@ ["#." artifact (#+ Artifact) ["#/." extension]]]]]}) -(def: (make-sources! fs sources) +(def: (make_sources! fs sources) (-> (file.System Promise) (Set Path) (Promise (Try Any))) - (loop [sources (set.to-list sources)] + (loop [sources (set.to_list sources)] (case sources #.Nil (|> [] @@ -65,9 +65,9 @@ (#.Cons head tail) (do (try.with promise.monad) [_ (: (Promise (Try Path)) - (file.make-directories promise.monad fs head)) + (file.make_directories promise.monad fs head)) _ (: (Promise (Try (File Promise))) - (file.get-file promise.monad fs (format head (\ fs separator) head ".lux")))] + (file.get_file promise.monad fs (format head (\ fs separator) head ".lux")))] (recur tail))))) (def: (execute! program repository fs artifact profile) @@ -78,67 +78,67 @@ [home (\ program home [])] (do ///action.monad [#let [console (@version.echo "")] - _ (..make-sources! fs (get@ #///.sources profile)) + _ (..make_sources! fs (get@ #///.sources profile)) _ (: (Promise (Try Path)) - (file.make-directories promise.monad fs (///local.repository fs home))) + (file.make_directories promise.monad fs (///local.repository fs home))) _ (/.do! console repository fs artifact profile)] - (!.use (\ console read-line) [])))) + (!.use (\ console read_line) [])))) (def: #export test Test (<| (_.covering /._) (do {! random.monad} - [[artifact expected-pom profile] + [[artifact expected_pom profile] (random.one (function (_ profile) (do maybe.monad [artifact (get@ #///.identity profile) - expected-pom (try.to-maybe (///pom.write profile))] - (wrap [artifact expected-pom profile]))) + expected_pom (try.to_maybe (///pom.write profile))] + (wrap [artifact expected_pom profile]))) @profile.random) home (random.ascii/alpha 5) - working-directory (random.ascii/alpha 5) + working_directory (random.ascii/alpha 5) #let [repository (///repository.mock @repository.simulation @repository.empty) fs (file.mock (\ file.default separator)) - program (program.async (program.mock environment.empty home working-directory))]] + program (program.async (program.mock environment.empty home working_directory))]] (wrap (do {! promise.monad} [verdict (do {! ///action.monad} [logging (..execute! program repository fs artifact profile) - expected-library (|> profile + expected_library (|> profile (get@ #///.sources) - set.to-list + set.to_list (export.library fs) (\ ! map (format.run tar.writer))) - actual-pom (\ repository download (///repository.uri artifact ///artifact/extension.pom)) - actual-library (\ repository download (///repository.uri artifact ///artifact/extension.lux-library)) - actual-sha-1 (\ repository download (///repository.uri artifact (format ///artifact/extension.lux-library ///artifact/extension.sha-1))) - actual-md5 (\ repository download (///repository.uri artifact (format ///artifact/extension.lux-library ///artifact/extension.md5))) + actual_pom (\ repository download (///repository.uri artifact ///artifact/extension.pom)) + actual_library (\ repository download (///repository.uri artifact ///artifact/extension.lux_library)) + actual_sha-1 (\ repository download (///repository.uri artifact (format ///artifact/extension.lux_library ///artifact/extension.sha-1))) + actual_md5 (\ repository download (///repository.uri artifact (format ///artifact/extension.lux_library ///artifact/extension.md5))) - #let [deployed-library! + #let [deployed_library! (\ binary.equivalence = - expected-library - actual-library) + expected_library + actual_library) - deployed-pom! + deployed_pom! (\ binary.equivalence = - (|> expected-pom (\ xml.codec encode) (\ encoding.utf8 encode)) - actual-pom) + (|> expected_pom (\ xml.codec encode) (\ encoding.utf8 encode)) + actual_pom) - deployed-sha-1! + deployed_sha-1! (\ binary.equivalence = - (///hash.data (///hash.sha-1 expected-library)) - actual-sha-1) + (///hash.data (///hash.sha-1 expected_library)) + actual_sha-1) - deployed-md5! + deployed_md5! (\ binary.equivalence = - (///hash.data (///hash.md5 expected-library)) - actual-md5)]] + (///hash.data (///hash.md5 expected_library)) + actual_md5)]] (wrap (and (text\= //clean.success logging) - deployed-library! - deployed-pom! - deployed-sha-1! - deployed-md5!)))] + deployed_library! + deployed_pom! + deployed_sha-1! + deployed_md5!)))] (_.cover' [/.do!] (try.default false verdict))))))) diff --git a/stdlib/source/test/aedifex/command/deps.lux b/stdlib/source/test/aedifex/command/deps.lux index 84c51dc93..7002238e7 100644 --- a/stdlib/source/test/aedifex/command/deps.lux +++ b/stdlib/source/test/aedifex/command/deps.lux @@ -52,55 +52,55 @@ (<| (_.covering /._) (do random.monad [home (random.ascii/alpha 5) - working-directory (random.ascii/alpha 5) + working_directory (random.ascii/alpha 5) - dependee-artifact $///artifact.random - depender-artifact (random.filter (predicate.complement - (\ ///artifact.equivalence = dependee-artifact)) + dependee_artifact $///artifact.random + depender_artifact (random.filter (predicate.complement + (\ ///artifact.equivalence = dependee_artifact)) $///artifact.random) - [_ dependee-package] $///package.random - [_ depender-package] $///package.random + [_ dependee_package] $///package.random + [_ depender_package] $///package.random - #let [dependee {#///dependency.artifact dependee-artifact - #///dependency.type ///artifact/type.lux-library} - depender {#///dependency.artifact depender-artifact - #///dependency.type ///artifact/type.lux-library} + #let [dependee {#///dependency.artifact dependee_artifact + #///dependency.type ///artifact/type.lux_library} + depender {#///dependency.artifact depender_artifact + #///dependency.type ///artifact/type.lux_library} - dependee-pom (|> (\ ///.monoid identity) - (set@ #///.identity (#.Some dependee-artifact)) + dependee_pom (|> (\ ///.monoid identity) + (set@ #///.identity (#.Some dependee_artifact)) ///pom.write try.assume) - depender-pom (|> (\ ///.monoid identity) - (set@ #///.identity (#.Some depender-artifact)) - (set@ #///.dependencies (set.from-list ///dependency.hash (list dependee))) + depender_pom (|> (\ ///.monoid identity) + (set@ #///.identity (#.Some depender_artifact)) + (set@ #///.dependencies (set.from_list ///dependency.hash (list dependee))) ///pom.write try.assume) - dependee-package (|> dependee-package + dependee_package (|> dependee_package (set@ #///package.origin #///package.Remote) - (set@ #///package.pom [dependee-pom #///dependency/status.Unverified])) - depender-package (|> depender-package + (set@ #///package.pom [dependee_pom #///dependency/status.Unverified])) + depender_package (|> depender_package (set@ #///package.origin #///package.Remote) - (set@ #///package.pom [depender-pom #///dependency/status.Unverified])) + (set@ #///package.pom [depender_pom #///dependency/status.Unverified])) fs (file.mock (\ file.default separator)) - program (program.async (program.mock environment.empty home working-directory))]] + program (program.async (program.mock environment.empty home working_directory))]] (wrap (do promise.monad [verdict (do ///action.monad [#let [console (@version.echo "")] pre (|> ///dependency/resolution.empty - (dictionary.put dependee dependee-package) - (///cache.write-all program fs)) + (dictionary.put dependee dependee_package) + (///cache.write_all program fs)) post (|> (\ ///.monoid identity) - (set@ #///.dependencies (set.from-list ///dependency.hash (list dependee depender))) - (/.do! program console fs (list (///repository.mock ($///dependency/resolution.single depender-artifact depender-package) [])))) + (set@ #///.dependencies (set.from_list ///dependency.hash (list dependee depender))) + (/.do! program console fs (list (///repository.mock ($///dependency/resolution.single depender_artifact depender_package) [])))) logging! (\ ///action.monad map (text\= //clean.success) - (!.use (\ console read-line) []))] + (!.use (\ console read_line) []))] (wrap (and logging! - (and (set.member? pre dependee-artifact) - (not (set.member? pre depender-artifact))) + (and (set.member? pre dependee_artifact) + (not (set.member? pre depender_artifact))) (and (dictionary.key? post dependee) (dictionary.key? post depender)))))] (_.cover' [/.do!] diff --git a/stdlib/source/test/aedifex/command/install.lux b/stdlib/source/test/aedifex/command/install.lux index 9ffa65bab..9df49efa4 100644 --- a/stdlib/source/test/aedifex/command/install.lux +++ b/stdlib/source/test/aedifex/command/install.lux @@ -44,9 +44,9 @@ ["#." artifact ["#/." extension]]]]]}) -(def: (make-sources! fs sources) +(def: (make_sources! fs sources) (-> (file.System Promise) (Set Path) (Promise (Try Any))) - (loop [sources (set.to-list sources)] + (loop [sources (set.to_list sources)] (case sources #.Nil (|> [] @@ -56,9 +56,9 @@ (#.Cons head tail) (do (try.with promise.monad) [_ (: (Promise (Try Path)) - (file.make-directories promise.monad fs head)) + (file.make_directories promise.monad fs head)) _ (: (Promise (Try (File Promise))) - (file.get-file promise.monad fs (format head (\ fs separator) head ".lux")))] + (file.get_file promise.monad fs (format head (\ fs separator) head ".lux")))] (recur tail))))) (def: (execute! program fs sample) @@ -67,11 +67,11 @@ [home (\ program home [])] (do ///action.monad [#let [console (@version.echo "")] - _ (..make-sources! fs (get@ #///.sources sample)) + _ (..make_sources! fs (get@ #///.sources sample)) _ (: (Promise (Try Path)) - (file.make-directories promise.monad fs (///local.repository fs home))) + (file.make_directories promise.monad fs (///local.repository fs home))) _ (/.do! program console fs sample)] - (!.use (\ console read-line) [])))) + (!.use (\ console read_line) [])))) (def: #export test Test @@ -81,33 +81,33 @@ sample (\ ! map (set@ #///.identity (#.Some identity)) @profile.random) home (random.ascii/alpha 5) - working-directory (random.ascii/alpha 5)] + working_directory (random.ascii/alpha 5)] ($_ _.and (wrap (do {! promise.monad} [#let [fs (file.mock (\ file.default separator)) - program (program.async (program.mock environment.empty home working-directory))] + program (program.async (program.mock environment.empty home working_directory))] verdict (do ///action.monad [logging (..execute! program fs sample) - #let [artifact-path (format (///local.path fs home identity) + #let [artifact_path (format (///local.path fs home identity) (\ fs separator) (///artifact.identity identity)) - library-path (format artifact-path ///artifact/extension.lux-library) - pom-path (format artifact-path ///artifact/extension.pom)] + library_path (format artifact_path ///artifact/extension.lux_library) + pom_path (format artifact_path ///artifact/extension.pom)] - library-exists! (\ promise.monad map + library_exists! (\ promise.monad map exception.return - (file.file-exists? promise.monad fs library-path)) - pom-exists! (\ promise.monad map + (file.file_exists? promise.monad fs library_path)) + pom_exists! (\ promise.monad map exception.return - (file.file-exists? promise.monad fs pom-path))] + (file.file_exists? promise.monad fs pom_path))] (wrap (and (text\= //clean.success logging) - library-exists! - pom-exists!)))] + library_exists! + pom_exists!)))] (_.cover' [/.do!] (try.default false verdict)))) (wrap (do {! promise.monad} [#let [fs (file.mock (\ file.default separator)) - program (program.async (program.mock environment.empty home working-directory))] + program (program.async (program.mock environment.empty home working_directory))] logging (..execute! program fs (set@ #///.identity #.None sample))] (_.cover' [/.failure] (|> logging diff --git a/stdlib/source/test/aedifex/command/pom.lux b/stdlib/source/test/aedifex/command/pom.lux index d179031ea..33c102926 100644 --- a/stdlib/source/test/aedifex/command/pom.lux +++ b/stdlib/source/test/aedifex/command/pom.lux @@ -49,21 +49,21 @@ (try\map (|>> (\ xml.codec encode) (\ encoding.utf8 encode))) (\ ! wrap)) file (: (Promise (Try (File Promise))) - (file.get-file promise.monad fs path)) + (file.get_file promise.monad fs path)) actual (!.use (\ file content) []) logging! (\ ///action.monad map (text\= //clean.success) - (!.use (\ console read-line) [])) + (!.use (\ console read_line) [])) - #let [expected-path! + #let [expected_path! (text\= ///pom.file path) - expected-content! + expected_content! (\ binary.equivalence = expected actual)]] (wrap (and logging! - expected-path! - expected-content!)))] + expected_path! + expected_content!)))] (_.cover' [/.do!] (try.default false verdict))) diff --git a/stdlib/source/test/aedifex/command/test.lux b/stdlib/source/test/aedifex/command/test.lux index b63662bc0..2d077ab87 100644 --- a/stdlib/source/test/aedifex/command/test.lux +++ b/stdlib/source/test/aedifex/command/test.lux @@ -45,32 +45,32 @@ [program (random.ascii/alpha 5) target (random.ascii/alpha 5) home (random.ascii/alpha 5) - working-directory (random.ascii/alpha 5) - #let [empty-profile (: Profile + working_directory (random.ascii/alpha 5) + #let [empty_profile (: Profile (\ ///.monoid identity)) - with-target (: (-> Profile Profile) + with_target (: (-> Profile Profile) (set@ #///.target (#.Some target))) - with-program (: (-> Profile Profile) + with_program (: (-> Profile Profile) (set@ #///.program (#.Some program))) - profile (|> empty-profile - with-program - with-target)] + profile (|> empty_profile + with_program + with_target)] resolution @build.resolution] ($_ _.and (let [fs (file.mock (\ file.default separator)) console (@version.echo "")] (wrap (do promise.monad [verdict (do ///action.monad - [_ (/.do! console (program.async (program.mock environment.empty home working-directory)) fs (@build.good-shell []) resolution profile) - build-start (!.use (\ console read-line) []) - build-end (!.use (\ console read-line) []) - test-start (!.use (\ console read-line) []) - test-end (!.use (\ console read-line) [])] - (wrap (and (and (text\= //build.start build-start) - (text\= //build.success build-end)) - (and (text\= /.start test-start) - (text\= /.success test-end)))))] + [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs (@build.good_shell []) resolution profile) + build_start (!.use (\ console read_line) []) + build_end (!.use (\ console read_line) []) + test_start (!.use (\ console read_line) []) + test_end (!.use (\ console read_line) [])] + (wrap (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.default false verdict))))) @@ -78,33 +78,33 @@ console (@version.echo "")] (wrap (do promise.monad [verdict (do ///action.monad - [#let [bad-shell (shell.mock - (function (_ [actual-environment actual-working-directory actual-command actual-arguments]) + [#let [bad_shell (shell.mock + (function (_ [actual_environment actual_working_directory actual_command actual_arguments]) (#try.Success (: (shell.Simulation []) (structure - (def: (on-read state) - (#try.Failure "on-read")) - (def: (on-error state) - (#try.Failure "on-error")) - (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 (text.ends-with? " build" actual-command) + (def: (on_read state) + (#try.Failure "on_read")) + (def: (on_error state) + (#try.Failure "on_error")) + (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 (text.ends_with? " build" actual_command) shell.normal shell.error)])))))) [])] - _ (/.do! console (program.async (program.mock environment.empty home working-directory)) fs bad-shell resolution profile) - build-start (!.use (\ console read-line) []) - build-end (!.use (\ console read-line) []) - test-start (!.use (\ console read-line) []) - test-end (!.use (\ console read-line) [])] - (wrap (and (and (text\= //build.start build-start) - (text\= //build.success build-end)) - (and (text\= /.start test-start) - (text\= /.failure test-end)))))] + _ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs bad_shell resolution profile) + build_start (!.use (\ console read_line) []) + build_end (!.use (\ console read_line) []) + test_start (!.use (\ console read_line) []) + test_end (!.use (\ console read_line) [])] + (wrap (and (and (text\= //build.start build_start) + (text\= //build.success build_end)) + (and (text\= /.start test_start) + (text\= /.failure test_end)))))] (_.cover' [/.failure] (try.default false verdict))))) )))) diff --git a/stdlib/source/test/aedifex/command/version.lux b/stdlib/source/test/aedifex/command/version.lux index 5e60f6b9b..ee26b3b5d 100644 --- a/stdlib/source/test/aedifex/command/version.lux +++ b/stdlib/source/test/aedifex/command/version.lux @@ -29,34 +29,34 @@ {#program ["." /]}) -(exception: #export console-is-closed!) +(exception: #export console_is_closed!) (structure: simulation (Simulation [Bit Text]) - (def: (on-read [open? state]) + (def: (on_read [open? state]) (if open? - (try.from-maybe + (try.from_maybe (do maybe.monad [head (text.nth 0 state) [_ tail] (text.split 1 state)] (wrap [[open? tail] head]))) - (exception.throw ..console-is-closed! []))) - (def: (on-read-line [open? state]) + (exception.throw ..console_is_closed! []))) + (def: (on_read_line [open? state]) (if open? - (try.from-maybe + (try.from_maybe (do maybe.monad - [[output state] (text.split-with text.new-line state)] + [[output state] (text.split_with text.new_line state)] (wrap [[open? state] output]))) - (exception.throw ..console-is-closed! []))) - (def: (on-write input [open? state]) + (exception.throw ..console_is_closed! []))) + (def: (on_write input [open? state]) (if open? (#try.Success [open? (format state input)]) - (exception.throw ..console-is-closed! []))) - (def: (on-close [open? buffer]) + (exception.throw ..console_is_closed! []))) + (def: (on_close [open? buffer]) (if open? (#try.Success [false buffer]) - (exception.throw ..console-is-closed! [])))) + (exception.throw ..console_is_closed! [])))) (def: #export echo (-> Text (Console Promise)) @@ -71,7 +71,7 @@ [#let [console (..echo "")] verdict (do (try.with promise.monad) [_ (/.do! console profile) - logging (!.use (\ console read-line) [])] + logging (!.use (\ console read_line) [])] (wrap (text\= (version.format language/lux.version) logging)))] (_.cover' [/.do!] diff --git a/stdlib/source/test/aedifex/dependency/resolution.lux b/stdlib/source/test/aedifex/dependency/resolution.lux index 92ced9e74..5f262bce4 100644 --- a/stdlib/source/test/aedifex/dependency/resolution.lux +++ b/stdlib/source/test/aedifex/dependency/resolution.lux @@ -52,260 +52,260 @@ [artifact $///artifact.random [_ package] $///package.random] (wrap (dictionary.put {#///dependency.artifact artifact - #///dependency.type ///artifact/type.lux-library} + #///dependency.type ///artifact/type.lux_library} package /.empty)))) (def: #export (single artifact package) (-> Artifact Package (Simulation Any)) (structure - (def: (on-download uri state) + (def: (on_download uri state) (if (text.contains? (///artifact.uri artifact) uri) - (cond (text.ends-with? ///artifact/extension.lux-library uri) + (cond (text.ends_with? ///artifact/extension.lux_library uri) (#try.Success [state (|> package (get@ #///package.library) product.left)]) - (text.ends-with? ///artifact/extension.pom uri) + (text.ends_with? ///artifact/extension.pom uri) (#try.Success [state (|> package (get@ #///package.pom) product.left (\ xml.codec encode) (\ encoding.utf8 encode))]) - ## (text.ends-with? ///artifact/extension.sha-1 uri) + ## (text.ends_with? ///artifact/extension.sha-1 uri) ## (#try.Success [state (|> package ## (get@ #///package.sha-1) - ## (\ ///hash.sha-1-codec encode) + ## (\ ///hash.sha-1_codec encode) ## (\ encoding.utf8 encode))]) - ## (text.ends-with? ///artifact/extension.md5 uri) + ## (text.ends_with? ///artifact/extension.md5 uri) ## (#try.Success [state (|> package ## (get@ #///package.md5) - ## (\ ///hash.md5-codec encode) + ## (\ ///hash.md5_codec encode) ## (\ encoding.utf8 encode))]) ## else (#try.Failure "NOPE")) (#try.Failure "NOPE"))) - (def: (on-upload uri binary state) + (def: (on_upload uri binary state) (#try.Failure "NOPE")))) (def: one Test (do {! random.monad} - [expected-artifact $///artifact.random - [_ expected-package] $///package.random - [_ dummy-package] (random.filter (|>> product.right - (set@ #///package.pom (get@ #///package.pom expected-package)) - (\ ///package.equivalence = expected-package) + [expected_artifact $///artifact.random + [_ expected_package] $///package.random + [_ dummy_package] (random.filter (|>> product.right + (set@ #///package.pom (get@ #///package.pom expected_package)) + (\ ///package.equivalence = expected_package) not) $///package.random) - #let [good (..single expected-artifact expected-package) - bad-sha-1 (: (Simulation Any) + #let [good (..single expected_artifact expected_package) + bad_sha-1 (: (Simulation Any) (structure - (def: (on-download uri state) - (if (text.contains? (///artifact.uri expected-artifact) uri) - (cond (text.ends-with? ///artifact/extension.lux-library uri) - (#try.Success [state (|> expected-package + (def: (on_download uri state) + (if (text.contains? (///artifact.uri expected_artifact) uri) + (cond (text.ends_with? ///artifact/extension.lux_library uri) + (#try.Success [state (|> expected_package (get@ #///package.library) product.left)]) - (text.ends-with? ///artifact/extension.pom uri) - (#try.Success [state (|> expected-package + (text.ends_with? ///artifact/extension.pom uri) + (#try.Success [state (|> expected_package (get@ #///package.pom) product.left (\ xml.codec encode) (\ encoding.utf8 encode))]) ## (text\= extension ///artifact/extension.sha-1) - ## (#try.Success [state (|> dummy-package + ## (#try.Success [state (|> dummy_package ## (get@ #///package.sha-1) - ## (\ ///hash.sha-1-codec encode) + ## (\ ///hash.sha-1_codec encode) ## (\ encoding.utf8 encode))]) ## (text\= extension ///artifact/extension.md5) - ## (#try.Success [state (|> expected-package + ## (#try.Success [state (|> expected_package ## (get@ #///package.md5) - ## (\ ///hash.md5-codec encode) + ## (\ ///hash.md5_codec encode) ## (\ encoding.utf8 encode))]) ## else (#try.Failure "NOPE")) (#try.Failure "NOPE"))) - (def: (on-upload uri binary state) + (def: (on_upload uri binary state) (#try.Failure "NOPE")))) - bad-md5 (: (Simulation Any) + bad_md5 (: (Simulation Any) (structure - (def: (on-download uri state) - (if (text.contains? (///artifact.uri expected-artifact) uri) - (cond (text.ends-with? ///artifact/extension.lux-library uri) - (#try.Success [state (|> expected-package + (def: (on_download uri state) + (if (text.contains? (///artifact.uri expected_artifact) uri) + (cond (text.ends_with? ///artifact/extension.lux_library uri) + (#try.Success [state (|> expected_package (get@ #///package.library) product.left)]) - (text.ends-with? ///artifact/extension.pom uri) - (#try.Success [state (|> expected-package + (text.ends_with? ///artifact/extension.pom uri) + (#try.Success [state (|> expected_package (get@ #///package.pom) product.left (\ xml.codec encode) (\ encoding.utf8 encode))]) ## (text\= extension ///artifact/extension.sha-1) - ## (#try.Success [state (|> expected-package + ## (#try.Success [state (|> expected_package ## (get@ #///package.sha-1) - ## (\ ///hash.sha-1-codec encode) + ## (\ ///hash.sha-1_codec encode) ## (\ encoding.utf8 encode))]) ## (text\= extension ///artifact/extension.md5) - ## (#try.Success [state (|> dummy-package + ## (#try.Success [state (|> dummy_package ## (get@ #///package.md5) - ## (\ ///hash.md5-codec encode) + ## (\ ///hash.md5_codec encode) ## (\ encoding.utf8 encode))]) ## else (#try.Failure "NOPE")) (#try.Failure "NOPE"))) - (def: (on-upload uri binary state) + (def: (on_upload uri binary state) (#try.Failure "NOPE"))))]] (`` ($_ _.and (wrap (do promise.monad - [actual-package (/.one (///repository.mock good []) - {#///dependency.artifact expected-artifact - #///dependency.type ///artifact/type.lux-library})] + [actual_package (/.one (///repository.mock good []) + {#///dependency.artifact expected_artifact + #///dependency.type ///artifact/type.lux_library})] (_.cover' [/.one] - (case actual-package - (#try.Success actual-package) + (case actual_package + (#try.Success actual_package) (\ ///package.equivalence = - (set@ #///package.origin #///package.Remote expected-package) - actual-package) + (set@ #///package.origin #///package.Remote expected_package) + actual_package) (#try.Failure _) false)))) (~~ (template [ ] [(wrap (do promise.monad - [actual-package (/.one (///repository.mock []) - {#///dependency.artifact expected-artifact - #///dependency.type ///artifact/type.lux-library})] + [actual_package (/.one (///repository.mock []) + {#///dependency.artifact expected_artifact + #///dependency.type ///artifact/type.lux_library})] (_.cover' [] - (case actual-package + (case actual_package (#try.Failure error) (exception.match? error) (#try.Success _) false))))] - [/.sha-1-does-not-match bad-sha-1] - [/.md5-does-not-match bad-md5] + [/.sha-1_does_not_match bad_sha-1] + [/.md5_does_not_match bad_md5] )) )))) (def: any Test (do {! random.monad} - [expected-artifact $///artifact.random - [_ expected-package] $///package.random - [_ dummy-package] (random.filter (|>> product.right - (set@ #///package.pom (get@ #///package.pom expected-package)) - (\ ///package.equivalence = expected-package) + [expected_artifact $///artifact.random + [_ expected_package] $///package.random + [_ dummy_package] (random.filter (|>> product.right + (set@ #///package.pom (get@ #///package.pom expected_package)) + (\ ///package.equivalence = expected_package) not) $///package.random) - #let [good (..single expected-artifact expected-package) - bad-sha-1 (: (Simulation Any) + #let [good (..single expected_artifact expected_package) + bad_sha-1 (: (Simulation Any) (structure - (def: (on-download uri state) - (if (text.contains? (///artifact.uri expected-artifact) uri) - (cond (text.ends-with? ///artifact/extension.lux-library uri) - (#try.Success [state (|> expected-package + (def: (on_download uri state) + (if (text.contains? (///artifact.uri expected_artifact) uri) + (cond (text.ends_with? ///artifact/extension.lux_library uri) + (#try.Success [state (|> expected_package (get@ #///package.library) product.left)]) - (text.ends-with? ///artifact/extension.pom uri) - (#try.Success [state (|> expected-package + (text.ends_with? ///artifact/extension.pom uri) + (#try.Success [state (|> expected_package (get@ #///package.pom) product.left (\ xml.codec encode) (\ encoding.utf8 encode))]) ## (text\= extension ///artifact/extension.sha-1) - ## (#try.Success [state (|> dummy-package + ## (#try.Success [state (|> dummy_package ## (get@ #///package.sha-1) - ## (\ ///hash.sha-1-codec encode) + ## (\ ///hash.sha-1_codec encode) ## (\ encoding.utf8 encode))]) ## (text\= extension ///artifact/extension.md5) - ## (#try.Success [state (|> expected-package + ## (#try.Success [state (|> expected_package ## (get@ #///package.md5) - ## (\ ///hash.md5-codec encode) + ## (\ ///hash.md5_codec encode) ## (\ encoding.utf8 encode))]) ## else (#try.Failure "NOPE")) (#try.Failure "NOPE"))) - (def: (on-upload uri binary state) + (def: (on_upload uri binary state) (#try.Failure "NOPE")))) - bad-md5 (: (Simulation Any) + bad_md5 (: (Simulation Any) (structure - (def: (on-download uri state) - (if (text.contains? (///artifact.uri expected-artifact) uri) - (cond (text.ends-with? ///artifact/extension.lux-library uri) - (#try.Success [state (|> expected-package + (def: (on_download uri state) + (if (text.contains? (///artifact.uri expected_artifact) uri) + (cond (text.ends_with? ///artifact/extension.lux_library uri) + (#try.Success [state (|> expected_package (get@ #///package.library) product.left)]) - (text.ends-with? ///artifact/extension.pom uri) - (#try.Success [state (|> expected-package + (text.ends_with? ///artifact/extension.pom uri) + (#try.Success [state (|> expected_package (get@ #///package.pom) product.left (\ xml.codec encode) (\ encoding.utf8 encode))]) ## (text\= extension ///artifact/extension.sha-1) - ## (#try.Success [state (|> expected-package + ## (#try.Success [state (|> expected_package ## (get@ #///package.sha-1) - ## (\ ///hash.sha-1-codec encode) + ## (\ ///hash.sha-1_codec encode) ## (\ encoding.utf8 encode))]) ## (text\= extension ///artifact/extension.md5) - ## (#try.Success [state (|> dummy-package + ## (#try.Success [state (|> dummy_package ## (get@ #///package.md5) - ## (\ ///hash.md5-codec encode) + ## (\ ///hash.md5_codec encode) ## (\ encoding.utf8 encode))]) ## else (#try.Failure "NOPE")) (#try.Failure "NOPE"))) - (def: (on-upload uri binary state) + (def: (on_upload uri binary state) (#try.Failure "NOPE"))))]] ($_ _.and (wrap (do promise.monad - [actual-package (/.any (list (///repository.mock bad-sha-1 []) - (///repository.mock bad-md5 []) + [actual_package (/.any (list (///repository.mock bad_sha-1 []) + (///repository.mock bad_md5 []) (///repository.mock good [])) - {#///dependency.artifact expected-artifact - #///dependency.type ///artifact/type.lux-library})] + {#///dependency.artifact expected_artifact + #///dependency.type ///artifact/type.lux_library})] (_.cover' [/.any] - (case actual-package - (#try.Success actual-package) + (case actual_package + (#try.Success actual_package) (\ ///package.equivalence = - (set@ #///package.origin #///package.Remote expected-package) - actual-package) + (set@ #///package.origin #///package.Remote expected_package) + actual_package) (#try.Failure _) false)))) (wrap (do promise.monad - [actual-package (/.any (list (///repository.mock bad-sha-1 []) - (///repository.mock bad-md5 [])) - {#///dependency.artifact expected-artifact - #///dependency.type ///artifact/type.lux-library})] - (_.cover' [/.cannot-resolve] - (case actual-package + [actual_package (/.any (list (///repository.mock bad_sha-1 []) + (///repository.mock bad_md5 [])) + {#///dependency.artifact expected_artifact + #///dependency.type ///artifact/type.lux_library})] + (_.cover' [/.cannot_resolve] + (case actual_package (#try.Failure error) - (exception.match? /.cannot-resolve error) + (exception.match? /.cannot_resolve error) (#try.Success _) false)))) @@ -314,49 +314,49 @@ (def: all Test (do {! random.monad} - [dependee-artifact $///artifact.random - depender-artifact (random.filter (predicate.complement - (\ ///artifact.equivalence = dependee-artifact)) + [dependee_artifact $///artifact.random + depender_artifact (random.filter (predicate.complement + (\ ///artifact.equivalence = dependee_artifact)) $///artifact.random) - ignored-artifact (random.filter (predicate.complement - (predicate.unite (\ ///artifact.equivalence = dependee-artifact) - (\ ///artifact.equivalence = depender-artifact))) + ignored_artifact (random.filter (predicate.complement + (predicate.unite (\ ///artifact.equivalence = dependee_artifact) + (\ ///artifact.equivalence = depender_artifact))) $///artifact.random) - [_ dependee-package] $///package.random - [_ depender-package] $///package.random - [_ ignored-package] $///package.random + [_ dependee_package] $///package.random + [_ depender_package] $///package.random + [_ ignored_package] $///package.random - #let [dependee {#///dependency.artifact dependee-artifact - #///dependency.type ///artifact/type.lux-library} - depender {#///dependency.artifact depender-artifact - #///dependency.type ///artifact/type.lux-library} - ignored {#///dependency.artifact ignored-artifact - #///dependency.type ///artifact/type.lux-library} + #let [dependee {#///dependency.artifact dependee_artifact + #///dependency.type ///artifact/type.lux_library} + depender {#///dependency.artifact depender_artifact + #///dependency.type ///artifact/type.lux_library} + ignored {#///dependency.artifact ignored_artifact + #///dependency.type ///artifact/type.lux_library} - dependee-pom (|> (\ ///.monoid identity) - (set@ #///.identity (#.Some dependee-artifact)) + dependee_pom (|> (\ ///.monoid identity) + (set@ #///.identity (#.Some dependee_artifact)) ///pom.write try.assume) - depender-pom (|> (\ ///.monoid identity) - (set@ #///.identity (#.Some depender-artifact)) - (set@ #///.dependencies (set.from-list ///dependency.hash (list dependee))) + depender_pom (|> (\ ///.monoid identity) + (set@ #///.identity (#.Some depender_artifact)) + (set@ #///.dependencies (set.from_list ///dependency.hash (list dependee))) ///pom.write try.assume) - ignored-pom (|> (\ ///.monoid identity) - (set@ #///.identity (#.Some ignored-artifact)) + ignored_pom (|> (\ ///.monoid identity) + (set@ #///.identity (#.Some ignored_artifact)) ///pom.write try.assume) - dependee-package (set@ #///package.pom [dependee-pom #///dependency/status.Unverified] dependee-package) - depender-package (set@ #///package.pom [depender-pom #///dependency/status.Unverified] depender-package) - ignored-package (set@ #///package.pom [ignored-pom #///dependency/status.Unverified] ignored-package)]] + dependee_package (set@ #///package.pom [dependee_pom #///dependency/status.Unverified] dependee_package) + depender_package (set@ #///package.pom [depender_pom #///dependency/status.Unverified] depender_package) + ignored_package (set@ #///package.pom [ignored_pom #///dependency/status.Unverified] ignored_package)]] ($_ _.and (wrap (do promise.monad - [resolution (/.all (list (///repository.mock (..single dependee-artifact dependee-package) []) - (///repository.mock (..single depender-artifact depender-package) []) - (///repository.mock (..single ignored-artifact ignored-package) [])) + [resolution (/.all (list (///repository.mock (..single dependee_artifact dependee_package) []) + (///repository.mock (..single depender_artifact depender_package) []) + (///repository.mock (..single ignored_artifact ignored_package) [])) (list depender) /.empty)] (_.cover' [/.all] diff --git a/stdlib/source/test/aedifex/hash.lux b/stdlib/source/test/aedifex/hash.lux index 455835b84..502130970 100644 --- a/stdlib/source/test/aedifex/hash.lux +++ b/stdlib/source/test/aedifex/hash.lux @@ -64,17 +64,17 @@ (#try.Failure error) (exception.match? error)))))] - [/.sha-1 /.as-sha-1 /.not-a-sha-1] - [/.md5 /.as-md5 /.not-a-md5] + [/.sha-1 /.as_sha-1 /.not_a_sha-1] + [/.md5 /.as_md5 /.not_a_md5] )))) (~~ (template [ ] [(_.for [] ($codec.spec /.equivalence (..random )))] - [/.sha-1-codec /.sha-1] - [/.md5-codec /.md5] + [/.sha-1_codec /.sha-1] + [/.md5_codec /.md5] )) - (_.for [/.not-a-hash] + (_.for [/.not_a_hash] ($_ _.and (~~ (template [ ] [(do random.monad @@ -87,9 +87,9 @@ false (#try.Failure error) - (exception.match? /.not-a-hash error))))] + (exception.match? /.not_a_hash error))))] - [/.sha-1-codec /.sha-1] - [/.md5-codec /.md5] + [/.sha-1_codec /.sha-1] + [/.md5_codec /.md5] )))) )))) diff --git a/stdlib/source/test/aedifex/input.lux b/stdlib/source/test/aedifex/input.lux index a0db21ba6..e2751381a 100644 --- a/stdlib/source/test/aedifex/input.lux +++ b/stdlib/source/test/aedifex/input.lux @@ -30,10 +30,10 @@ ["#." action] ["#." format]]]}) -(def: (with-default-source sources) +(def: (with_default_source sources) (-> (Set //.Source) (Set //.Source)) (if (set.empty? sources) - (set.add //.default-source sources) + (set.add //.default_source sources) sources)) (def: #export test @@ -46,16 +46,16 @@ (wrap (do promise.monad [verdict (do //action.monad [file (: (Promise (Try (File Promise))) - (file.get-file promise.monad fs //project.file)) + (file.get_file promise.monad fs //project.file)) _ (|> expected //format.profile %.code (\ encoding.utf8 encode) - (!.use (\ file over-write))) + (!.use (\ file over_write))) actual (: (Promise (Try Profile)) (/.read promise.monad fs //.default))] (wrap (\ //.equivalence = - (update@ #//.sources ..with-default-source expected) + (update@ #//.sources ..with_default_source expected) actual)))] (_.cover' [/.read] (try.default false verdict))))))) diff --git a/stdlib/source/test/aedifex/local.lux b/stdlib/source/test/aedifex/local.lux index b95bf2e19..7d0492815 100644 --- a/stdlib/source/test/aedifex/local.lux +++ b/stdlib/source/test/aedifex/local.lux @@ -30,8 +30,8 @@ ($_ _.and (_.cover [/.repository /.path] (let [path (/.path fs home sample)] - (and (text.starts-with? (/.repository fs home) + (and (text.starts_with? (/.repository fs home) path) - (text.ends-with? (//artifact.path fs sample) + (text.ends_with? (//artifact.path fs sample) path)))) )))) diff --git a/stdlib/source/test/aedifex/metadata.lux b/stdlib/source/test/aedifex/metadata.lux index 9dd3fac22..0cac022f8 100644 --- a/stdlib/source/test/aedifex/metadata.lux +++ b/stdlib/source/test/aedifex/metadata.lux @@ -24,9 +24,9 @@ [sample @artifact.random] ($_ _.and (_.cover [/.project] - (text.ends-with? /.file (/.project sample))) + (text.ends_with? /.file (/.project sample))) (_.cover [/.version] - (text.ends-with? /.file (/.version sample))) + (text.ends_with? /.file (/.version sample))) ))) /artifact.test diff --git a/stdlib/source/test/aedifex/metadata/artifact.lux b/stdlib/source/test/aedifex/metadata/artifact.lux index bb105f305..3177c6ff2 100644 --- a/stdlib/source/test/aedifex/metadata/artifact.lux +++ b/stdlib/source/test/aedifex/metadata/artifact.lux @@ -35,21 +35,21 @@ (do {! random.monad} [year (\ ! map (|>> (n.% 10,000) .int) random.nat) month (\ ! map (n.% 13) random.nat) - day-of-month (\ ! map (n.% 29) random.nat) + day_of_month (\ ! map (n.% 29) random.nat) hour (\ ! map (n.% 24) random.nat) minute (\ ! map (n.% 60) random.nat) second (\ ! map (n.% 60) random.nat)] (wrap (try.assume (do try.monad [year (year.year year) - month (month.by-number month) - date (date.date year month day-of-month) + month (month.by_number month) + date (date.date year month day_of_month) time (time.time {#time.hour hour #time.minute minute #time.second second - #time.milli-second 0})] - (wrap (instant.from-date-time date time)))))))) + #time.milli_second 0})] + (wrap (instant.from_date_time date time)))))))) (def: #export test Test diff --git a/stdlib/source/test/aedifex/metadata/snapshot.lux b/stdlib/source/test/aedifex/metadata/snapshot.lux index e17765038..e9e42be9a 100644 --- a/stdlib/source/test/aedifex/metadata/snapshot.lux +++ b/stdlib/source/test/aedifex/metadata/snapshot.lux @@ -29,31 +29,31 @@ {#program ["." /]}) -(def: random-instant +(def: random_instant (Random Instant) (do {! random.monad} [year (\ ! map (|>> (n.% 10,000) .int) random.nat) month (\ ! map (n.% 13) random.nat) - day-of-month (\ ! map (n.% 29) random.nat) + day_of_month (\ ! map (n.% 29) random.nat) hour (\ ! map (n.% 24) random.nat) minute (\ ! map (n.% 60) random.nat) second (\ ! map (n.% 60) random.nat)] (wrap (try.assume (do try.monad [year (year.year year) - month (month.by-number month) - date (date.date year month day-of-month) + month (month.by_number month) + date (date.date year month day_of_month) time (time.time {#time.hour hour #time.minute minute #time.second second - #time.milli-second 0})] - (wrap (instant.from-date-time date time))))))) + #time.milli_second 0})] + (wrap (instant.from_date_time date time))))))) -(def: random-versioning +(def: random_versioning (Random /.Versioning) ($_ random.and - ..random-instant + ..random_instant random.nat (random.list 5 $///type.random) )) @@ -64,7 +64,7 @@ (random.ascii/alpha 5) (random.ascii/alpha 5) (random.ascii/alpha 5) - ..random-versioning)) + ..random_versioning)) (def: #export test Test diff --git a/stdlib/source/test/aedifex/package.lux b/stdlib/source/test/aedifex/package.lux index 56169a766..7562547df 100644 --- a/stdlib/source/test/aedifex/package.lux +++ b/stdlib/source/test/aedifex/package.lux @@ -34,10 +34,10 @@ (def: #export random (Random [//.Profile /.Package]) (do {! random.monad} - [content-size (\ ! map (n.% 100) random.nat) - content (_binary.random content-size) + [content_size (\ ! map (n.% 100) random.nat) + content (_binary.random content_size) [profile pom] (random.one (function (_ profile) - (try.to-maybe + (try.to_maybe (do try.monad [pom (//pom.write profile)] (wrap [profile pom])))) diff --git a/stdlib/source/test/aedifex/parser.lux b/stdlib/source/test/aedifex/parser.lux index 7aeff7a18..1eb62b75d 100644 --- a/stdlib/source/test/aedifex/parser.lux +++ b/stdlib/source/test/aedifex/parser.lux @@ -36,32 +36,32 @@ (Random //.Name) (random.ascii/alpha 1)) -(def: (list-of random) +(def: (list_of random) (All [a] (-> (Random a) (Random (List a)))) (do {! random.monad} [size (\ ! map (n.% 5) random.nat)] (random.list size random))) -(def: (dictionary-of key-hash key-random value-random) +(def: (dictionary_of key_hash key_random value_random) (All [k v] (-> (Hash k) (Random k) (Random v) (Random (Dictionary k v)))) (\ random.functor map - (dictionary.from-list key-hash) - (..list-of (random.and key-random value-random)))) + (dictionary.from_list key_hash) + (..list_of (random.and key_random value_random)))) (def: random (Random Project) - (..dictionary-of text.hash ..name @profile.random)) + (..dictionary_of text.hash ..name @profile.random)) -(def: with-default-sources +(def: with_default_sources (-> //.Profile //.Profile) (update@ #//.sources (: (-> (Set //.Source) (Set //.Source)) (function (_ sources) (if (set.empty? sources) - (set.from-list text.hash (list //.default-source)) + (set.from_list text.hash (list //.default_source)) sources))))) -(def: single-profile +(def: single_profile Test (do random.monad [expected @profile.random] @@ -72,20 +72,20 @@ (.run /.project) (case> (#try.Success actual) (|> expected - ..with-default-sources + ..with_default_sources (//project.project //.default) (\ //project.equivalence = actual)) (#try.Failure error) false))))) -(def: (with-empty-profile project) +(def: (with_empty_profile project) (-> Project Project) (if (dictionary.empty? project) (//project.project //.default (\ //.monoid identity)) project)) -(def: multiple-profiles +(def: multiple_profiles Test (do random.monad [expected ..random] @@ -96,11 +96,11 @@ (.run /.project) (case> (#try.Success actual) (|> expected - ..with-empty-profile + ..with_empty_profile dictionary.entries (list\map (function (_ [name profile]) - [name (..with-default-sources profile)])) - (dictionary.from-list text.hash) + [name (..with_default_sources profile)])) + (dictionary.from_list text.hash) (\ //project.equivalence = actual)) (#try.Failure error) @@ -113,6 +113,6 @@ (_.for [/.project //format.Format //format.profile //format.project] ($_ _.and - ..single-profile - ..multiple-profiles + ..single_profile + ..multiple_profiles )))) diff --git a/stdlib/source/test/aedifex/pom.lux b/stdlib/source/test/aedifex/pom.lux index fefdfb7bb..c87ff0590 100644 --- a/stdlib/source/test/aedifex/pom.lux +++ b/stdlib/source/test/aedifex/pom.lux @@ -42,7 +42,7 @@ [(#try.Failure error) #.None] - (exception.match? //.no-identity error) + (exception.match? //.no_identity error) _ false))))) diff --git a/stdlib/source/test/aedifex/profile.lux b/stdlib/source/test/aedifex/profile.lux index 1743a243a..9316fae66 100644 --- a/stdlib/source/test/aedifex/profile.lux +++ b/stdlib/source/test/aedifex/profile.lux @@ -69,23 +69,23 @@ (Random /.Contributor) ..developer) -(def: (list-of random) +(def: (list_of random) (All [a] (-> (Random a) (Random (List a)))) (do {! random.monad} [size (\ ! map (n.% 5) random.nat)] (random.list size random))) -(def: (set-of hash random) +(def: (set_of hash random) (All [a] (-> (Hash a) (Random a) (Random (Set a)))) (\ random.functor map - (set.from-list hash) - (..list-of random))) + (set.from_list hash) + (..list_of random))) -(def: (dictionary-of key-hash key-random value-random) +(def: (dictionary_of key_hash key_random value_random) (All [k v] (-> (Hash k) (Random k) (Random v) (Random (Dictionary k v)))) (\ random.functor map - (dictionary.from-list key-hash) - (..list-of (random.and key-random value-random)))) + (dictionary.from_list key_hash) + (..list_of (random.and key_random value_random)))) (def: info (Random /.Info) @@ -93,10 +93,10 @@ (random.maybe (random.ascii/alpha 1)) (random.maybe ..scm) (random.maybe (random.ascii/alpha 1)) - (..list-of ..license) + (..list_of ..license) (random.maybe ..organization) - (..list-of ..developer) - (..list-of ..contributor) + (..list_of ..developer) + (..list_of ..contributor) )) (def: name @@ -118,16 +118,16 @@ (def: #export random (Random /.Profile) ($_ random.and - (..list-of ..name) + (..list_of ..name) (random.maybe @artifact.random) (random.maybe ..info) - (..set-of text.hash ..repository) - (..set-of //dependency.hash @dependency.random) - (..set-of text.hash ..source) + (..set_of text.hash ..repository) + (..set_of //dependency.hash @dependency.random) + (..set_of text.hash ..source) (random.maybe ..target) (random.maybe (random.ascii/alpha 1)) (random.maybe (random.ascii/alpha 1)) - (..dictionary-of text.hash (random.ascii/alpha 1) ..repository) + (..dictionary_of text.hash (random.ascii/alpha 1) ..repository) )) (def: #export test diff --git a/stdlib/source/test/aedifex/project.lux b/stdlib/source/test/aedifex/project.lux index 4ea00a3c4..cec9c0cae 100644 --- a/stdlib/source/test/aedifex/project.lux +++ b/stdlib/source/test/aedifex/project.lux @@ -47,50 +47,50 @@ ($monoid.spec /.equivalence /.monoid ..random)) (do random.monad - [[super-name super-profile] ..profile - [dummy-name dummy-profile] (random.filter (|>> product.left (text\= super-name) not) + [[super_name super_profile] ..profile + [dummy_name dummy_profile] (random.filter (|>> product.left (text\= super_name) not) ..profile) - [sub-name sub-profile] (random.filter (function (_ [name profile]) - (and (not (text\= super-name name)) - (not (text\= dummy-name name)))) + [sub_name sub_profile] (random.filter (function (_ [name profile]) + (and (not (text\= super_name name)) + (not (text\= dummy_name name)))) ..profile) - fake-name (random.filter (function (_ name) - (and (not (text\= super-name name)) - (not (text\= dummy-name name)) - (not (text\= sub-name name)))) + fake_name (random.filter (function (_ name) + (and (not (text\= super_name name)) + (not (text\= dummy_name name)) + (not (text\= sub_name name)))) (random.ascii/alpha 1)) #let [project ($_ (\ /.monoid compose) - (/.project super-name super-profile) - (/.project dummy-name dummy-profile) - (/.project sub-name (set@ #//.parents (list super-name) sub-profile))) + (/.project super_name super_profile) + (/.project dummy_name dummy_profile) + (/.project sub_name (set@ #//.parents (list super_name) sub_profile))) circular ($_ (\ /.monoid compose) - (/.project super-name (set@ #//.parents (list sub-name) super-profile)) - (/.project dummy-name dummy-profile) - (/.project sub-name (set@ #//.parents (list super-name) sub-profile)))]] + (/.project super_name (set@ #//.parents (list sub_name) super_profile)) + (/.project dummy_name dummy_profile) + (/.project sub_name (set@ #//.parents (list super_name) sub_profile)))]] ($_ _.and (_.cover [/.profile] - (and (|> (/.profile super-name project) - (try\map (\ //.equivalence = super-profile)) + (and (|> (/.profile super_name project) + (try\map (\ //.equivalence = super_profile)) (try.default false)) - (|> (/.profile dummy-name project) - (try\map (\ //.equivalence = dummy-profile)) + (|> (/.profile dummy_name project) + (try\map (\ //.equivalence = dummy_profile)) (try.default false)) - (|> (/.profile sub-name project) - (try\map (\ //.equivalence = (\ //.monoid compose sub-profile super-profile))) + (|> (/.profile sub_name project) + (try\map (\ //.equivalence = (\ //.monoid compose sub_profile super_profile))) (try.default false)))) - (_.cover [/.unknown-profile] - (case (/.profile fake-name project) + (_.cover [/.unknown_profile] + (case (/.profile fake_name project) (#try.Success _) false (#try.Failure error) - (exception.match? /.unknown-profile error))) - (_.cover [/.circular-dependency] - (case (/.profile sub-name circular) + (exception.match? /.unknown_profile error))) + (_.cover [/.circular_dependency] + (case (/.profile sub_name circular) (#try.Success _) false (#try.Failure error) - (exception.match? /.circular-dependency error))) + (exception.match? /.circular_dependency error))) )) )))) diff --git a/stdlib/source/test/aedifex/repository.lux b/stdlib/source/test/aedifex/repository.lux index af96bc572..7b99d080f 100644 --- a/stdlib/source/test/aedifex/repository.lux +++ b/stdlib/source/test/aedifex/repository.lux @@ -37,7 +37,7 @@ (-> Version Artifact) (|>> ["com.github.luxlang" "test-artifact"])) -(exception: (not-found {uri URI}) +(exception: (not_found {uri URI}) (exception.report ["URI" (%.text uri)])) @@ -51,14 +51,14 @@ (structure: #export simulation (/.Simulation Store) - (def: (on-download uri state) + (def: (on_download uri state) (case (dictionary.get uri state) (#.Some content) (exception.return [state content]) #.None - (exception.throw ..not-found [uri]))) - (def: (on-upload uri content state) + (exception.throw ..not_found [uri]))) + (def: (on_upload uri content state) (exception.return (dictionary.put uri content state)))) (def: #export test diff --git a/stdlib/source/test/aedifex/runtime.lux b/stdlib/source/test/aedifex/runtime.lux index e1c0a77c1..17b3428d2 100644 --- a/stdlib/source/test/aedifex/runtime.lux +++ b/stdlib/source/test/aedifex/runtime.lux @@ -19,8 +19,8 @@ (~~ (template [] [(_.cover [] (let [command ( path)] - (and (text.starts-with? ( "") command) - (text.ends-with? path command))))] + (and (text.starts_with? ( "") command) + (text.ends_with? path command))))] [/.java] [/.node] -- cgit v1.2.3