Skip to content

Commit

Permalink
Add another testcase and fix a bug in A.parseBreakChunksK
Browse files Browse the repository at this point in the history
  • Loading branch information
adithyaov committed Oct 8, 2024
1 parent 937825c commit f609342
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/Streamly/Internal/Data/Array.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ parseBreakChunksK (Parser pstep initial extract) stream = do
let n = Prelude.length backBuf
arr0 = fromListN n (Prelude.reverse backBuf)
arr1 = Array contents cur end
str = StreamK.cons arr0 (StreamK.cons arr1 stream)
str = StreamK.cons arr0 (StreamK.fromPure arr1)
return (Left (ParseError err), str)

-- This is a simplified goExtract
Expand Down
7 changes: 7 additions & 0 deletions test/Streamly/Test/Data/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1436,6 +1436,13 @@ parserSanityTests desc testRunner =
, Custom (P.Continue 10 ())
, Custom (P.Done 5 ())
]
Prelude.mapM_ testRunner $
createPaths
[ Consume tapeLen
, Custom (P.Continue 0 ())
, Custom (P.Continue 10 ())
, Custom (P.Error "Message3")
]

{-
TODO:
Expand Down

0 comments on commit f609342

Please sign in to comment.