From 8428d0dd068ba675473297e52a679722cb976398 Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Sat, 11 Feb 2023 23:35:15 +0100 Subject: [PATCH] ignore notes when deciding to show a group fix #1 --- TAP.idr | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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