aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/parser.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/aedifex/parser.lux')
-rw-r--r--stdlib/source/test/aedifex/parser.lux31
1 files changed, 15 insertions, 16 deletions
diff --git a/stdlib/source/test/aedifex/parser.lux b/stdlib/source/test/aedifex/parser.lux
index 54cdbc17a..cbc67dbab 100644
--- a/stdlib/source/test/aedifex/parser.lux
+++ b/stdlib/source/test/aedifex/parser.lux
@@ -6,7 +6,7 @@
[hash (.only Hash)]]
[control
["[0]" pipe]
- ["[0]" try]]
+ ["[0]" try (.use "[1]#[0]" functor)]]
[data
["[0]" text]
[collection
@@ -40,7 +40,7 @@
(def (list_of random)
(All (_ a) (-> (Random a) (Random (List a))))
(do [! random.monad]
- [size (at ! each (n.% 5) random.nat)]
+ [size (at ! each (|>> (n.% 5) ++) random.nat)]
(random.list size random)))
(def (dictionary_of key_hash key_random value_random)
@@ -72,6 +72,16 @@
(//project.project //.default (at //.monoid identity))
project))
+(def with_defaults
+ (-> Project Project)
+ (|>> ..with_empty_profile
+ dictionary.entries
+ (list#each (function (_ [name profile])
+ [name (|> profile
+ ..with_default_sources
+ ..with_default_repository)]))
+ (dictionary.of_list text.hash)))
+
(def .public test
Test
(<| (_.covering /._)
@@ -84,17 +94,6 @@
//format.project
list
(<code>.result /.project)
- (pipe.when
- {try.#Success actual}
- (|> expected
- ..with_empty_profile
- dictionary.entries
- (list#each (function (_ [name profile])
- [name (|> profile
- ..with_default_sources
- ..with_default_repository)]))
- (dictionary.of_list text.hash)
- (at //project.equivalence = actual))
-
- {try.#Failure error}
- false))))))
+ (try#each (at //project.equivalence = (..with_defaults expected)))
+ (try.else false)
+ )))))