Closed gzh closed 1 month ago
@andreasabel @phadej Any updates on this simple fix for a nasty bug (caused by use of partial function init
)?
Tests are failing, e.g. https://github.com/haskell-hvr/cassava/actions/runs/7400077740/job/20151432820?pr=222#step:20:84
escapedMalformed1: [Failed]
Building the tests also fails, e.g. https://github.com/haskell-hvr/cassava/actions/runs/7400077740/job/20151434424?pr=222#step:19:34
tests/UnitTests.hs:64:52: error: • Variable not in scope: (<>) :: IO a0 -> String -> Assertion
Fixup of this PR in
Hi,
There's a problem with escaped fields parser, -- it is partial on opening double quote. Means, it throws Haskell
error
instead of properly failing. The problem is because of ByteString.init being called on possibly empty bytestring (w/o checking). This small PR suggest a fix for this, plus adds some tests for decoding of escaped input.