diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/aedifex/metadata.lux | 92 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/metadata/artifact.lux | 116 | ||||
-rw-r--r-- | stdlib/source/test/aedifex/metadata/snapshot.lux | 86 |
3 files changed, 147 insertions, 147 deletions
diff --git a/stdlib/source/test/aedifex/metadata.lux b/stdlib/source/test/aedifex/metadata.lux index b3176a5c7..5ff5988ee 100644 --- a/stdlib/source/test/aedifex/metadata.lux +++ b/stdlib/source/test/aedifex/metadata.lux @@ -1,51 +1,51 @@ (.using - [library - [lux "*" - ["_" test {"+" Test}] - [abstract - [monad {"+" do}]] - [data - ["[0]" text ("[1]#[0]" equivalence)]] - [math - ["[0]" random]]]] - ["[0]" / "_" - ["[1][0]" artifact] - ["[1][0]" snapshot] - [// - ["$[0]" artifact]]] - [\\program - ["[0]" /]]) + [library + [lux "*" + ["_" test {"+" Test}] + [abstract + [monad {"+" do}]] + [data + ["[0]" text ("[1]#[0]" equivalence)]] + [math + ["[0]" random]]]] + ["[0]" / "_" + ["[1][0]" artifact] + ["[1][0]" snapshot] + [// + ["$[0]" artifact]]] + [\\program + ["[0]" /]]) (def: .public test Test (<| (_.covering /._) - ($_ _.and - (do random.monad - [sample $artifact.random] - ($_ _.and - (_.cover [/.remote_artifact_uri /.remote_project_uri] - (not (text#= (/.remote_artifact_uri sample) - (/.remote_project_uri sample)))) - (_.cover [/.local_uri] - (let [remote_artifact_uri (/.remote_artifact_uri sample) - remote_project_uri (/.remote_project_uri sample)] - (and (not (text#= remote_artifact_uri (/.local_uri remote_artifact_uri))) - (not (text#= remote_project_uri (/.local_uri remote_project_uri)))))) - (_.cover [/.remote_uri] - (let [remote_artifact_uri (/.remote_artifact_uri sample) - remote_project_uri (/.remote_project_uri sample)] - (and (text#= remote_artifact_uri (/.remote_uri remote_artifact_uri)) - (text#= remote_project_uri (/.remote_uri remote_project_uri)) - (|> remote_artifact_uri - /.local_uri - /.remote_uri - (text#= remote_artifact_uri)) - (|> remote_project_uri - /.local_uri - /.remote_uri - (text#= remote_project_uri))))) - )) - - /artifact.test - /snapshot.test - ))) + (all _.and + (do random.monad + [sample $artifact.random] + (all _.and + (_.cover [/.remote_artifact_uri /.remote_project_uri] + (not (text#= (/.remote_artifact_uri sample) + (/.remote_project_uri sample)))) + (_.cover [/.local_uri] + (let [remote_artifact_uri (/.remote_artifact_uri sample) + remote_project_uri (/.remote_project_uri sample)] + (and (not (text#= remote_artifact_uri (/.local_uri remote_artifact_uri))) + (not (text#= remote_project_uri (/.local_uri remote_project_uri)))))) + (_.cover [/.remote_uri] + (let [remote_artifact_uri (/.remote_artifact_uri sample) + remote_project_uri (/.remote_project_uri sample)] + (and (text#= remote_artifact_uri (/.remote_uri remote_artifact_uri)) + (text#= remote_project_uri (/.remote_uri remote_project_uri)) + (|> remote_artifact_uri + /.local_uri + /.remote_uri + (text#= remote_artifact_uri)) + (|> remote_project_uri + /.local_uri + /.remote_uri + (text#= remote_project_uri))))) + )) + + /artifact.test + /snapshot.test + ))) diff --git a/stdlib/source/test/aedifex/metadata/artifact.lux b/stdlib/source/test/aedifex/metadata/artifact.lux index bf94bf600..1459a88e5 100644 --- a/stdlib/source/test/aedifex/metadata/artifact.lux +++ b/stdlib/source/test/aedifex/metadata/artifact.lux @@ -43,28 +43,28 @@ (def: .public random (Random /.Metadata) - ($_ random.and - (random.ascii/alpha 5) - (random.ascii/alpha 5) - (random.list 5 (random.ascii/alpha 5)) - (do [! random.monad] - [year (# ! each (|>> (n.% 9,000) (n.+ 1,000) .int) random.nat) - month (# ! each (|>> (n.% 12) (n.+ 1)) random.nat) - day_of_month (# ! each (|>> (n.% 28) (n.+ 1)) random.nat) - hour (# ! each (n.% 24) random.nat) - minute (# ! each (n.% 60) random.nat) - second (# ! each (n.% 60) random.nat)] - (in (try.trusted - (do try.monad - [year (year.year year) - 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])] - (in (instant.of_date_time date time)))))))) + (all random.and + (random.ascii/alpha 5) + (random.ascii/alpha 5) + (random.list 5 (random.ascii/alpha 5)) + (do [! random.monad] + [year (# ! each (|>> (n.% 9,000) (n.+ 1,000) .int) random.nat) + month (# ! each (|>> (n.% 12) (n.+ 1)) random.nat) + day_of_month (# ! each (|>> (n.% 28) (n.+ 1)) random.nat) + hour (# ! each (n.% 24) random.nat) + minute (# ! each (n.% 60) random.nat) + second (# ! each (n.% 60) random.nat)] + (in (try.trusted + (do try.monad + [year (year.year year) + 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])] + (in (instant.of_date_time date time)))))))) (def: .public test Test @@ -78,39 +78,39 @@ (the /.#versions) list.head (maybe.else ""))]]] - ($_ _.and - (_.for [/.equivalence] - ($equivalence.spec /.equivalence ..random)) - - (do random.monad - [expected ..random] - (_.cover [/.format /.parser] - (|> expected - /.format - list - (<xml>.result /.parser) - (try#each (# /.equivalence = expected)) - (try.else false)))) - (_.cover [/.uri] - (text#= (//.remote_project_uri artifact) - (/.uri artifact))) - (do random.monad - [home (random.ascii/lower 5) - working_directory (random.ascii/lower 5) - .let [program (program.async (program.mock environment.empty home working_directory)) - fs (file.mock (# file.default separator)) - repository (///repository/local.repository program fs)]] - (in (do async.monad - [wrote? (/.write repository artifact expected) - actual (/.read repository artifact)] - (_.cover' [/.write /.read] - (and (case wrote? - {try.#Success _} true - {try.#Failure _} false) - (case actual - {try.#Success actual} - (# /.equivalence = expected actual) - - {try.#Failure _} - false)))))) - )))) + (all _.and + (_.for [/.equivalence] + ($equivalence.spec /.equivalence ..random)) + + (do random.monad + [expected ..random] + (_.cover [/.format /.parser] + (|> expected + /.format + list + (<xml>.result /.parser) + (try#each (# /.equivalence = expected)) + (try.else false)))) + (_.cover [/.uri] + (text#= (//.remote_project_uri artifact) + (/.uri artifact))) + (do random.monad + [home (random.ascii/lower 5) + working_directory (random.ascii/lower 5) + .let [program (program.async (program.mock environment.empty home working_directory)) + fs (file.mock (# file.default separator)) + repository (///repository/local.repository program fs)]] + (in (do async.monad + [wrote? (/.write repository artifact expected) + actual (/.read repository artifact)] + (_.cover' [/.write /.read] + (and (case wrote? + {try.#Success _} true + {try.#Failure _} false) + (case actual + {try.#Success actual} + (# /.equivalence = expected actual) + + {try.#Failure _} + false)))))) + )))) diff --git a/stdlib/source/test/aedifex/metadata/snapshot.lux b/stdlib/source/test/aedifex/metadata/snapshot.lux index 4735a6994..bb862dca2 100644 --- a/stdlib/source/test/aedifex/metadata/snapshot.lux +++ b/stdlib/source/test/aedifex/metadata/snapshot.lux @@ -72,18 +72,18 @@ (def: random_versioning (Random Versioning) - ($_ random.and - (random#in {///snapshot.#Local}) - $///artifact/time.random - (random.list 5 $///artifact/snapshot/version.random) - )) + (all random.and + (random#in {///snapshot.#Local}) + $///artifact/time.random + (random.list 5 $///artifact/snapshot/version.random) + )) (def: .public random (Random /.Metadata) - ($_ random.and - $///artifact.random - ..random_versioning - )) + (all random.and + $///artifact.random + ..random_versioning + )) (def: .public test Test @@ -92,37 +92,37 @@ (do random.monad [expected ..random .let [artifact (the /.#artifact expected)]] - ($_ _.and - (_.for [/.equivalence] - ($equivalence.spec /.equivalence ..random)) - - (_.cover [/.format /.parser] - (|> expected - /.format - list - (<xml>.result /.parser) - (try#each (# /.equivalence = expected)) - (try.else false))) - (_.cover [/.uri] - (text#= (//.remote_artifact_uri artifact) - (/.uri artifact))) - (do random.monad - [home (random.ascii/lower 5) - working_directory (random.ascii/lower 5) - .let [program (program.async (program.mock environment.empty home working_directory)) - fs (file.mock (# file.default separator)) - repository (///repository/local.repository program fs)]] - (in (do async.monad - [wrote? (/.write repository artifact expected) - actual (/.read repository artifact)] - (_.cover' [/.write /.read] - (and (case wrote? - {try.#Success _} true - {try.#Failure _} false) - (case actual - {try.#Success actual} - (# /.equivalence = expected actual) - - {try.#Failure _} - false)))))) - )))) + (all _.and + (_.for [/.equivalence] + ($equivalence.spec /.equivalence ..random)) + + (_.cover [/.format /.parser] + (|> expected + /.format + list + (<xml>.result /.parser) + (try#each (# /.equivalence = expected)) + (try.else false))) + (_.cover [/.uri] + (text#= (//.remote_artifact_uri artifact) + (/.uri artifact))) + (do random.monad + [home (random.ascii/lower 5) + working_directory (random.ascii/lower 5) + .let [program (program.async (program.mock environment.empty home working_directory)) + fs (file.mock (# file.default separator)) + repository (///repository/local.repository program fs)]] + (in (do async.monad + [wrote? (/.write repository artifact expected) + actual (/.read repository artifact)] + (_.cover' [/.write /.read] + (and (case wrote? + {try.#Success _} true + {try.#Failure _} false) + (case actual + {try.#Success actual} + (# /.equivalence = expected actual) + + {try.#Failure _} + false)))))) + )))) |