From 772f621c19408c711c1e587668a52a8cfeeea418 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 12 Aug 2022 22:26:57 -0400 Subject: Fixes for Aedifex tests. --- stdlib/source/test/aedifex/parser.lux | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'stdlib/source/test/aedifex/parser.lux') 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 (.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) + ))))) -- cgit v1.2.3