extra test in decodeRawRows

I needed to make sure that a trailing comma on a row would leave a blank cell at the end of the row.
This commit is contained in:
Jonathan Lamothe 2022-04-21 00:02:38 -04:00
parent 389c206063
commit 9ec4d7e9c3

View File

@ -93,6 +93,7 @@ decodeRawRowsSpec = describe "decodeRawRows" $ mapM_
, ( "odd chunk", oddChunkIn, normalRes )
, ( "no newline", noNewlineIn, normalRes )
, ( "malformed", malformedIn, malformedRes )
, ( "blank end", blankEndIn, blankEndRes )
]
where
@ -158,6 +159,11 @@ decodeRawRowsSpec = describe "decodeRawRows" $ mapM_
, "baz,quux\r\n"
]
blankEndIn =
[ "foo,bar,\r\n"
, "baz,quux\r\n"
]
normalRes =
[ ["foo", "bar"]
, ["baz", "quux"]
@ -188,6 +194,11 @@ decodeRawRowsSpec = describe "decodeRawRows" $ mapM_
, ["baz", "quux"]
]
blankEndRes =
[ ["foo", "bar", ""]
, ["baz", "quux"]
]
decodeUTF8Spec :: Spec
decodeUTF8Spec = describe "decodeUTF8" $ mapM_
( \(label, input, expected) -> context label $