diff --git a/TAP.idr b/TAP.idr index 22ffd75..13d828c 100644 --- a/TAP.idr +++ b/TAP.idr @@ -332,11 +332,10 @@ mutual filterMatch1 : String -> Test -> Maybe Test filterMatch1 pat test@(One base) = guard (pat `isInfixOf` base.label) $> test - filterMatch1 pat all@(Group label tests) = - if pat `isInfixOf` label then Just all else - case filterMatch (Just pat) tests of - [] => Nothing - res => Just $ Group label res + filterMatch1 pat whole@(Group label tests) = + if pat `isInfixOf` label then Just whole else + let res = filterMatch (Just pat) tests in + guard (any isRealTest res) $> Group label res filterMatch1 pat note@(Note _) = Just note