on master help sign in
Fix the test case for Parser.takeFramedByEsc_
commit3d8ffee6840259aa870cddcb9665f17e5478a79e authorAdithya Kumar <adithya@composewell.com> dateWed 27 Jul 2022, 15:24 (4 years ago) parent93cc79d
1 file changed+7−2
test/Streamly/Test/Data/Parser.hs+7−2
test/Streamly/Test/Data/Parser.hs+7−2
@@ -936,6 +936,11 @@ takeFramedByEsc_ =
936936 Just _ -> checkPass xs Nothing openMinusClose
937937 checkPass [] _ _ = False
938938
939+ checkPassBeg [] = False
940+ checkPassBeg xxs@(x:_)
941+ | isBegin x = checkPass xxs Nothing (0 :: Int)
942+ | otherwise = False
943+
939944 escapeFrame begin end escape l =
940945 let
941946 helper (x : xs) maybePrevEsc openMinusClose =
@@ -969,12 +974,12 @@ takeFramedByEsc_ =
969974 in
970975 case S.parse prsr (S.fromList ls) of
971976 Right parsed_list ->
972− if checkPass ls Nothing (0 :: Int)
977+ if checkPassBeg ls
973978 then checkListEqual parsed_list $
974979 escapeFrame isBegin isEnd isEsc ls
975980 else property False
976981 Left _ ->
977− if checkPass ls Nothing (0 :: Int)
982+ if checkPassBeg ls
978983 then property False
979984 else property True
980985