on master help sign in
Fix the test case for Parser.takeFramedByEsc_
3d8ffeeAdithya Kumar
test/Streamly/Test/Data/Parser.hs+7−2
@@ -936,6 +936,11 @@ takeFramedByEsc_ =
936 Just _ -> checkPass xs Nothing openMinusClose
936 Just _ -> checkPass xs Nothing openMinusClose
937 checkPass [] _ _ = False
937 checkPass [] _ _ = False
938
938
939+ checkPassBeg [] = False
940+ checkPassBeg xxs@(x:_)
941+ | isBegin x = checkPass xxs Nothing (0 :: Int)
942+ | otherwise = False
943+
939 escapeFrame begin end escape l =
944 escapeFrame begin end escape l =
940 let
945 let
941 helper (x : xs) maybePrevEsc openMinusClose =
946 helper (x : xs) maybePrevEsc openMinusClose =
@@ -969,12 +974,12 @@ takeFramedByEsc_ =
969 in
974 in
970 case S.parse prsr (S.fromList ls) of
975 case S.parse prsr (S.fromList ls) of
971 Right parsed_list ->
976 Right parsed_list ->
972− if checkPass ls Nothing (0 :: Int)
977+ if checkPassBeg ls
973 then checkListEqual parsed_list $
978 then checkListEqual parsed_list $
974 escapeFrame isBegin isEnd isEsc ls
979 escapeFrame isBegin isEnd isEsc ls
975 else property False
980 else property False
976 Left _ ->
981 Left _ ->
977− if checkPass ls Nothing (0 :: Int)
982+ if checkPassBeg ls
978 then property False
983 then property False
979 else property True
984 else property True
980
985