mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
Shrink Child contents respecting their prefixes/suffixes.
This commit is contained in:
parent
ff3691eac4
commit
96f94c9bdb
@ -212,7 +212,9 @@ instance Arbitrary BranchElement where
|
||||
, Join . That <$> g
|
||||
, (Join .) . These <$> g <*> g ]
|
||||
|
||||
shrink (Child key contents) = Child key <$> traverse (shrinkList (const [])) contents
|
||||
shrink (Child key contents) = Child key <$> traverse shrinkContents contents
|
||||
where shrinkContents string = (++ suffix) . (prefix ++) <$> shrinkList (const []) (drop (length prefix) (take (length string - length suffix) string))
|
||||
(prefix, suffix) = ('(' : key, ")" :: String)
|
||||
shrink (Margin contents) = Margin <$> traverse (shrinkList (const [])) contents
|
||||
|
||||
instance Show BranchElement where
|
||||
|
Loading…
Reference in New Issue
Block a user