From e1161b46db1f81292ea1f4695ce8b8c58421aaca Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 11 Dec 2015 11:17:51 -0500 Subject: [PATCH] Shrink Fixed subterms recursively. --- test/Spec.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Spec.hs b/test/Spec.hs index ab448d203..2edd7d488 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -28,7 +28,7 @@ instance (Eq a, Eq annotation, Arbitrary a, Arbitrary annotation) => Arbitrary ( shrink term@(ArbitraryTerm (annotation, syntax)) = filter (/= term) $ ArbitraryTerm <$> ((,) <$> shrink annotation <*> shrinkSyntax syntax) where shrinkSyntax (Leaf a) = Leaf <$> shrink a shrinkSyntax (Indexed i) = (getSyntax <$> i) ++ (Indexed <$> (shrink =<< List.subsequences i)) - shrinkSyntax (Syntax.Fixed f) = (getSyntax <$> f) ++ (Syntax.Fixed <$> List.subsequences f) + shrinkSyntax (Syntax.Fixed f) = (getSyntax <$> f) ++ (Syntax.Fixed <$> (shrink =<< List.subsequences f)) shrinkSyntax (Keyed k) = (getSyntax . snd <$> (Map.toList k)) ++ (Keyed . Map.fromList <$> shrink (Map.toList k)) getSyntax (ArbitraryTerm (_, syntax)) = syntax