Skip to content

Commit

Permalink
Add regression test for haskell#197
Browse files Browse the repository at this point in the history
(cherry picked from commit 758c116)
  • Loading branch information
bgamari authored and strake committed Mar 2, 2021
1 parent 639b580 commit b227448
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Tests/Regressions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,22 @@ mapAccumL_resize = do
assertEqual "mapAccumL should correctly size buffers for 4-byte results"
(count * 4) (T.lengthWord8 (snd val))

-- See GitHub #197
t197 :: IO ()
t197 =
assertBool "length (filter (==',') \"0,00\") should be 1" (currencyParser "0,00")
where
currencyParser x = cond == 1
where
cond = length fltr
fltr = filter (== ',') x

tests :: F.Test
tests = F.testGroup "Regressions"
[ F.testCase "hGetContents_crash" hGetContents_crash
, F.testCase "lazy_encode_crash" lazy_encode_crash
, F.testCase "mapAccumL_resize" mapAccumL_resize
, F.testCase "replicate_crash" replicate_crash
, F.testCase "utf8_decode_unsafe" utf8_decode_unsafe
, F.testCase "t197" t197
]

0 comments on commit b227448

Please sign in to comment.