diff options
Diffstat (limited to 'stdlib/source/test/lux/tool/compiler/phase/synthesis/structure.lux')
-rw-r--r-- | stdlib/source/test/lux/tool/compiler/phase/synthesis/structure.lux | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/stdlib/source/test/lux/tool/compiler/phase/synthesis/structure.lux b/stdlib/source/test/lux/tool/compiler/phase/synthesis/structure.lux index 76405c771..087756562 100644 --- a/stdlib/source/test/lux/tool/compiler/phase/synthesis/structure.lux +++ b/stdlib/source/test/lux/tool/compiler/phase/synthesis/structure.lux @@ -12,6 +12,8 @@ [data ["." bit ("#@." equivalence)] ["." product] + [number + ["n" nat]] [collection ["." list]]]] ["." // #_ @@ -29,9 +31,9 @@ (def: variant Test (do r.monad - [size (|> r.nat (:: @ map (|>> (n/% 10) (n/+ 2)))) - tagA (|> r.nat (:: @ map (n/% size))) - #let [right? (n/= (dec size) tagA) + [size (|> r.nat (:: @ map (|>> (n.% 10) (n.+ 2)))) + tagA (|> r.nat (:: @ map (n.% size))) + #let [right? (n.= (dec size) tagA) lefts (if right? (dec tagA) tagA)] @@ -42,8 +44,8 @@ (///.run [///bundle.empty ////synthesis.init]) (case> (^ (#try.Success (////synthesis.variant [leftsS right?S valueS]))) (let [tagS (if right?S (inc leftsS) leftsS)] - (and (n/= tagA tagS) - (|> tagS (n/= (dec size)) (bit@= right?S)) + (and (n.= tagA tagS) + (|> tagS (n.= (dec size)) (bit@= right?S)) (//primitive.corresponds? memberA valueS))) _ @@ -52,14 +54,14 @@ (def: tuple Test (do r.monad - [size (|> r.nat (:: @ map (|>> (n/% 10) (n/max 2)))) + [size (|> r.nat (:: @ map (|>> (n.% 10) (n.max 2)))) membersA (r.list size //primitive.primitive)] (_.test "Can synthesize tuple." (|> (////analysis.tuple membersA) //.phase (///.run [///bundle.empty ////synthesis.init]) (case> (^ (#try.Success (////synthesis.tuple membersS))) - (and (n/= size (list.size membersS)) + (and (n.= size (list.size membersS)) (list.every? (product.uncurry //primitive.corresponds?) (list.zip2 membersA membersS))) |