aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/metadata/artifact.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/aedifex/metadata/artifact.lux')
-rw-r--r--stdlib/source/test/aedifex/metadata/artifact.lux116
1 files changed, 58 insertions, 58 deletions
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))))))
+ ))))