Fix the test case for Parser.takeFramedByEsc_

This commit is contained in:
Adithya Kumar 2022-07-27 15:24:08 +05:30
parent 93cc79d156
commit 3d8ffee684

View File

@ -936,6 +936,11 @@ takeFramedByEsc_ =
Just _ -> checkPass xs Nothing openMinusClose
checkPass [] _ _ = False
checkPassBeg [] = False
checkPassBeg xxs@(x:_)
| isBegin x = checkPass xxs Nothing (0 :: Int)
| otherwise = False
escapeFrame begin end escape l =
let
helper (x : xs) maybePrevEsc openMinusClose =
@ -969,12 +974,12 @@ takeFramedByEsc_ =
in
case S.parse prsr (S.fromList ls) of
Right parsed_list ->
if checkPass ls Nothing (0 :: Int)
if checkPassBeg ls
then checkListEqual parsed_list $
escapeFrame isBegin isEnd isEsc ls
else property False
Left _ ->
if checkPass ls Nothing (0 :: Int)
if checkPassBeg ls
then property False
else property True