diff options
Diffstat (limited to 'new-luxc/test/test/luxc/synthesizer/structure.lux')
-rw-r--r-- | new-luxc/test/test/luxc/synthesizer/structure.lux | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/new-luxc/test/test/luxc/synthesizer/structure.lux b/new-luxc/test/test/luxc/synthesizer/structure.lux index 8cc61d02f..441f422bb 100644 --- a/new-luxc/test/test/luxc/synthesizer/structure.lux +++ b/new-luxc/test/test/luxc/synthesizer/structure.lux @@ -14,32 +14,36 @@ (.. common)) (context: "Variants" - [size (|> r;nat (:: @ map (|>. (n.% +10) (n.max +2)))) - tagA (|> r;nat (:: @ map (n.% size))) - memberA gen-primitive] - ($_ seq - (test "Can synthesize variants." - (|> (synthesizer;synthesize (la;sum tagA size +0 memberA)) - (case> (#ls;Variant tagS last?S memberS) - (and (n.= tagA tagS) - (B/= (n.= (n.dec size) tagA) - last?S) - (corresponds? memberA memberS)) - - _ - false))) - )) + (<| (times +100) + (do @ + [size (|> r;nat (:: @ map (|>. (n.% +10) (n.max +2)))) + tagA (|> r;nat (:: @ map (n.% size))) + memberA gen-primitive] + ($_ seq + (test "Can synthesize variants." + (|> (synthesizer;synthesize (la;sum tagA size +0 memberA)) + (case> (#ls;Variant tagS last?S memberS) + (and (n.= tagA tagS) + (B/= (n.= (n.dec size) tagA) + last?S) + (corresponds? memberA memberS)) + + _ + false))) + )))) (context: "Tuples" - [size (|> r;nat (:: @ map (|>. (n.% +10) (n.max +2)))) - membersA (r;list size gen-primitive)] - ($_ seq - (test "Can synthesize tuple." - (|> (synthesizer;synthesize (la;product membersA)) - (case> (#ls;Tuple membersS) - (and (n.= size (list;size membersS)) - (list;every? (product;uncurry corresponds?) (list;zip2 membersA membersS))) + (<| (times +100) + (do @ + [size (|> r;nat (:: @ map (|>. (n.% +10) (n.max +2)))) + membersA (r;list size gen-primitive)] + ($_ seq + (test "Can synthesize tuple." + (|> (synthesizer;synthesize (la;product membersA)) + (case> (#ls;Tuple membersS) + (and (n.= size (list;size membersS)) + (list;every? (product;uncurry corresponds?) (list;zip2 membersA membersS))) - _ - false))) - )) + _ + false))) + )))) |