diff options
author | Eduardo Julian | 2022-08-11 04:15:07 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-08-11 04:15:07 -0400 |
commit | 065e8a4d8122d4616b570496915d2c0e2c78cd6b (patch) | |
tree | f2bbdc3e40b796b34026ab04c9a478d8a3f082d5 /stdlib/source/test/aedifex | |
parent | 68d78235694c633c956bb9e8a007cad7d65370bc (diff) |
Re-named the "case" macro to "when".
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/aedifex/artifact/time/date.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/cli.lux | 8 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/command/auto.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/command/build.lux | 10 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/command/pom.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/dependency/deployment.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/dependency/resolution.lux | 8 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/dependency/status.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/hash.lux | 6 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/metadata/artifact.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/metadata/snapshot.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/package.lux | 10 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/parser.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/pom.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/project.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/repository.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/repository/local.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/repository/remote.lux | 6 |
18 files changed, 42 insertions, 42 deletions
diff --git a/stdlib/source/test/aedifex/artifact/time/date.lux b/stdlib/source/test/aedifex/artifact/time/date.lux index e50626c79..5efc00d4e 100644 --- a/stdlib/source/test/aedifex/artifact/time/date.lux +++ b/stdlib/source/test/aedifex/artifact/time/date.lux @@ -60,7 +60,7 @@ (try#each (at /.equivalence = expected)) (try.else false))) (_.coverage [/.year_is_out_of_range] - (case (/.date candidate) + (when (/.date candidate) {try.#Success date} (same? candidate (/.value date)) diff --git a/stdlib/source/test/aedifex/cli.lux b/stdlib/source/test/aedifex/cli.lux index a27e90074..b388866c6 100644 --- a/stdlib/source/test/aedifex/cli.lux +++ b/stdlib/source/test/aedifex/cli.lux @@ -53,13 +53,13 @@ (def (compilation_format value) (-> /.Compilation (List Text)) - (case value + (when value {/.#Build} (list "build") {/.#Test} (list "test"))) (def (format value) (-> /.Command (List Text)) - (case value + (when value {/.#Version} (list "version") {/.#Clean} (list "clean") {/.#POM} (list "pom") @@ -77,7 +77,7 @@ (|> expected ..format (cli.result /.command) - (pipe.case + (pipe.when {try.#Success [names actual]} (and (at (list.equivalence text.equivalence) = (list //.default) names) (at /.equivalence = expected actual)) @@ -95,7 +95,7 @@ ..format (list.partial "with" expected_profile) (cli.result /.command) - (pipe.case + (pipe.when {try.#Success [actual_profile actual_command]} (and (at (list.equivalence text.equivalence) = (list expected_profile //.default) actual_profile) (at /.equivalence = expected_command actual_command)) diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux index 5dc092327..b202af97f 100644 --- a/stdlib/source/test/aedifex/command/auto.lux +++ b/stdlib/source/test/aedifex/command/auto.lux @@ -110,7 +110,7 @@ fs (shell.async ($build.good_shell [])) resolution) - (at ! each (|>> (pipe.case + (at ! each (|>> (pipe.when {try.#Failure error} (same? end_signal error) diff --git a/stdlib/source/test/aedifex/command/build.lux b/stdlib/source/test/aedifex/command/build.lux index 9aea4828c..c039b6e9c 100644 --- a/stdlib/source/test/aedifex/command/build.lux +++ b/stdlib/source/test/aedifex/command/build.lux @@ -85,7 +85,7 @@ (def (on_read state) (if error? (exception.except shell.no_more_output []) - (case state + (when state {.#Item head tail} {try.#Success [tail head]} @@ -93,7 +93,7 @@ (exception.except shell.no_more_output [])))) (def (on_fail state) (if error? - (case state + (when state {.#Item head tail} {try.#Success [tail head]} @@ -165,7 +165,7 @@ [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty home working_directory)) fs shell ///dependency/resolution.empty (with_target empty_profile))] (unit.coverage [/.no_specified_program] - (case outcome + (when outcome {try.#Success _} false @@ -174,7 +174,7 @@ (in (do async.monad [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty home working_directory)) fs shell ///dependency/resolution.empty profile)] (unit.coverage [/.Lux /.no_available_lux] - (case outcome + (when outcome {try.#Success _} false @@ -234,7 +234,7 @@ actual/1 (at console read_line []) actual/2 (at console read_line []) end! (|> (at console read_line []) - (at ! each (|>> (pipe.case + (at ! each (|>> (pipe.when {try.#Failure error} true diff --git a/stdlib/source/test/aedifex/command/pom.lux b/stdlib/source/test/aedifex/command/pom.lux index 32a10f8a3..0d304f19d 100644 --- a/stdlib/source/test/aedifex/command/pom.lux +++ b/stdlib/source/test/aedifex/command/pom.lux @@ -41,7 +41,7 @@ (in (do [! async.monad] [.let [console (@version.echo "")] outcome (/.do! console fs sample)] - (case outcome + (when outcome {try.#Success _} (do ! [verdict (do ///action.monad @@ -64,7 +64,7 @@ {try.#Failure error} (unit.coverage [/.do!] - (case (the ///.#identity sample) + (when (the ///.#identity sample) {.#Some _} false diff --git a/stdlib/source/test/aedifex/dependency/deployment.lux b/stdlib/source/test/aedifex/dependency/deployment.lux index dbc458897..f94ef4421 100644 --- a/stdlib/source/test/aedifex/dependency/deployment.lux +++ b/stdlib/source/test/aedifex/dependency/deployment.lux @@ -69,7 +69,7 @@ (def (request method url headers input) (do io.monad [_ (is (IO Any) - (case [method input] + (when [method input] [{@http.#Put} {.#Some input}] (atom.update! (dictionary.has url input) cache) diff --git a/stdlib/source/test/aedifex/dependency/resolution.lux b/stdlib/source/test/aedifex/dependency/resolution.lux index 6bc81298e..0f353d828 100644 --- a/stdlib/source/test/aedifex/dependency/resolution.lux +++ b/stdlib/source/test/aedifex/dependency/resolution.lux @@ -265,7 +265,7 @@ [///dependency.#artifact expected_artifact ///dependency.#type ///artifact/type.lux_library])] (unit.coverage [/.one] - (case actual_package + (when actual_package {try.#Success actual_package} (at ///package.equivalence = (has ///package.#origin {///repository/origin.#Remote ""} expected_package) @@ -279,7 +279,7 @@ [///dependency.#artifact expected_artifact ///dependency.#type ///artifact/type.lux_library])] (unit.coverage [<exception>] - (case actual_package + (when actual_package {try.#Failure error} (exception.match? <exception> error) @@ -314,7 +314,7 @@ [///dependency.#artifact expected_artifact ///dependency.#type ///artifact/type.lux_library])] (unit.coverage [/.any] - (case actual_package + (when actual_package {try.#Success actual_package} (at ///package.equivalence = (has ///package.#origin {///repository/origin.#Remote ""} expected_package) @@ -330,7 +330,7 @@ [///dependency.#artifact expected_artifact ///dependency.#type ///artifact/type.lux_library])] (unit.coverage [/.cannot_resolve] - (case actual_package + (when actual_package {try.#Failure error} (exception.match? /.cannot_resolve error) diff --git a/stdlib/source/test/aedifex/dependency/status.lux b/stdlib/source/test/aedifex/dependency/status.lux index b61d35630..85edbdbf8 100644 --- a/stdlib/source/test/aedifex/dependency/status.lux +++ b/stdlib/source/test/aedifex/dependency/status.lux @@ -40,7 +40,7 @@ (do random.monad [payload (binaryT.random 1)] (_.coverage [/.verified] - (case (/.verified payload) + (when (/.verified payload) {/.#Verified sha1 md5} true diff --git a/stdlib/source/test/aedifex/hash.lux b/stdlib/source/test/aedifex/hash.lux index 61cb569fa..7271458b9 100644 --- a/stdlib/source/test/aedifex/hash.lux +++ b/stdlib/source/test/aedifex/hash.lux @@ -50,13 +50,13 @@ [(do random.monad [expected (..random <hash>)] (_.coverage [<hash> <constructor> <exception>] - (and (case (<constructor> (/.data expected)) + (and (when (<constructor> (/.data expected)) {try.#Success actual} (at /.equivalence = expected actual) {try.#Failure error} false) - (case (<constructor> (at binary.monoid composite + (when (<constructor> (at binary.monoid composite (/.data expected) (/.data expected))) {try.#Success actual} @@ -81,7 +81,7 @@ [(do random.monad [expected (..random <hash>)] (_.coverage [<codec>] - (case (at <codec> decoded + (when (at <codec> decoded (format (at <codec> encoded expected) "AABBCC")) {try.#Success actual} diff --git a/stdlib/source/test/aedifex/metadata/artifact.lux b/stdlib/source/test/aedifex/metadata/artifact.lux index f67d1e130..f2d430fb2 100644 --- a/stdlib/source/test/aedifex/metadata/artifact.lux +++ b/stdlib/source/test/aedifex/metadata/artifact.lux @@ -108,10 +108,10 @@ [wrote? (/.write repository artifact expected) actual (/.read repository artifact)] (unit.coverage [/.write /.read] - (and (case wrote? + (and (when wrote? {try.#Success _} true {try.#Failure _} false) - (case actual + (when actual {try.#Success actual} (at /.equivalence = expected actual) diff --git a/stdlib/source/test/aedifex/metadata/snapshot.lux b/stdlib/source/test/aedifex/metadata/snapshot.lux index b41a6ce15..34965c98a 100644 --- a/stdlib/source/test/aedifex/metadata/snapshot.lux +++ b/stdlib/source/test/aedifex/metadata/snapshot.lux @@ -120,10 +120,10 @@ [wrote? (/.write repository artifact expected) actual (/.read repository artifact)] (unit.coverage [/.write /.read] - (and (case wrote? + (and (when wrote? {try.#Success _} true {try.#Failure _} false) - (case actual + (when actual {try.#Success actual} (at /.equivalence = expected actual) diff --git a/stdlib/source/test/aedifex/package.lux b/stdlib/source/test/aedifex/package.lux index 035765b17..dc03b1671 100644 --- a/stdlib/source/test/aedifex/package.lux +++ b/stdlib/source/test/aedifex/package.lux @@ -76,13 +76,13 @@ [actual_pom binary_pom pom_status] (the /.#pom local) [actual_library library_status] (the /.#library local)] - (and (case (the /.#origin local) + (and (when (the /.#origin local) {//origin.#Local ""} true _ false) (let [expected_sha1 (//hash.sha-1 expected_library) expected_md5 (//hash.md5 expected_library)] (and (same? expected_library actual_library) - (case library_status + (when library_status {//status.#Verified actual_sha1 expected_md5} (and (//hash#= expected_sha1 actual_sha1) (//hash#= expected_md5 expected_md5)) @@ -97,7 +97,7 @@ decoded_pom (at xml.codec decoded xml_pom)] (in (at xml.equivalence = actual_pom decoded_pom))) (try.else false)) - (case pom_status + (when pom_status {//status.#Verified actual_sha1 expected_md5} (and (//hash#= expected_sha1 actual_sha1) (//hash#= expected_md5 expected_md5)) @@ -106,7 +106,7 @@ false)))))) (_.coverage [/.dependencies] (let [expected (the //.#dependencies profile)] - (case (/.dependencies package) + (when (/.dependencies package) {try.#Success actual} (at set.equivalence = expected actual) @@ -114,7 +114,7 @@ false))) (_.coverage [/.repositories] (let [expected (the //.#repositories profile)] - (case (/.repositories package) + (when (/.repositories package) {try.#Success actual} (at set.equivalence = expected actual) diff --git a/stdlib/source/test/aedifex/parser.lux b/stdlib/source/test/aedifex/parser.lux index fb2852701..54cdbc17a 100644 --- a/stdlib/source/test/aedifex/parser.lux +++ b/stdlib/source/test/aedifex/parser.lux @@ -84,7 +84,7 @@ //format.project list (<code>.result /.project) - (pipe.case + (pipe.when {try.#Success actual} (|> expected ..with_empty_profile diff --git a/stdlib/source/test/aedifex/pom.lux b/stdlib/source/test/aedifex/pom.lux index c6283f30d..0484599e0 100644 --- a/stdlib/source/test/aedifex/pom.lux +++ b/stdlib/source/test/aedifex/pom.lux @@ -34,11 +34,11 @@ (do random.monad [expected @profile.random] (_.coverage [/.write /.parser] - (case [(/.write expected) + (when [(/.write expected) (the //.#identity expected)] [{try.#Success pom} {.#Some _}] - (case (<xml>.result /.parser (list pom)) + (when (<xml>.result /.parser (list pom)) {try.#Success actual} (at //.equivalence = (|> (at //.monoid identity) diff --git a/stdlib/source/test/aedifex/project.lux b/stdlib/source/test/aedifex/project.lux index 2db5873e8..29f8b1215 100644 --- a/stdlib/source/test/aedifex/project.lux +++ b/stdlib/source/test/aedifex/project.lux @@ -84,14 +84,14 @@ (try#each (at //.equivalence = (at //.monoid composite sub_profile super_profile))) (try.else false)))) (_.coverage [/.unknown_profile] - (case (/.profile project fake_name) + (when (/.profile project fake_name) {try.#Success _} false {try.#Failure error} (exception.match? /.unknown_profile error))) (_.coverage [/.circular_dependency] - (case (/.profile circular sub_name) + (when (/.profile circular sub_name) {try.#Success _} false diff --git a/stdlib/source/test/aedifex/repository.lux b/stdlib/source/test/aedifex/repository.lux index 72c36f74b..fbb3ef01b 100644 --- a/stdlib/source/test/aedifex/repository.lux +++ b/stdlib/source/test/aedifex/repository.lux @@ -72,9 +72,9 @@ (def the_description "@") (def (on_download uri state) - (case (dictionary.value uri state) + (when (dictionary.value uri state) {.#Some content} - (case (binary.size content) + (when (binary.size content) 0 (exception.except ..not_found [uri]) _ {try.#Success [state content]}) diff --git a/stdlib/source/test/aedifex/repository/local.lux b/stdlib/source/test/aedifex/repository/local.lux index 52a91bea6..96a07f678 100644 --- a/stdlib/source/test/aedifex/repository/local.lux +++ b/stdlib/source/test/aedifex/repository/local.lux @@ -45,7 +45,7 @@ _ (at repo upload uri expected) actual (at repo download uri)] (unit.coverage [/.repository] - (and (case before_upload + (and (when before_upload {try.#Success _} false {try.#Failure _} true) (|> actual diff --git a/stdlib/source/test/aedifex/repository/remote.lux b/stdlib/source/test/aedifex/repository/remote.lux index a5380ddec..5a1c21316 100644 --- a/stdlib/source/test/aedifex/repository/remote.lux +++ b/stdlib/source/test/aedifex/repository/remote.lux @@ -51,7 +51,7 @@ (dictionary.value "User-Agent") (maybe#each (same? /.user_agent)) (maybe.else false)) - (case [method input] + (when [method input] [{@http.#Get} {.#None}] [http/status.ok [@http.#headers (http.headers (list)) @@ -113,7 +113,7 @@ (let [repo (/.repository (..good_http user password) {.#None} address)] - (case (io.run! (at repo upload uri content)) + (when (io.run! (at repo upload uri content)) {try.#Failure error} (exception.match? /.upload_failure error) @@ -123,7 +123,7 @@ (let [repo (/.repository ..bad_http {.#None} address)] - (case (io.run! (at repo download uri)) + (when (io.run! (at repo download uri)) {try.#Failure error} (exception.match? /.download_failure error) |