Permalink
Browse files

Add tests for encoding of space delimited data

All tests are passing
  • Loading branch information...
1 parent fa7fe10 commit 1ca1784aa50f19d14124cfd7ae8b2058c0f042b6 @Shimuuar committed Mar 8, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 tests/UnitTests.hs
View
@@ -116,6 +116,14 @@ positionalTests =
[ testCase "tab-delim" $ encodesWithAs (defEnc { encDelimiter = 9 })
[["1", "2"]] "1\t2\r\n"
]
+ , testGroup "encodeSpace" $ map (\(n,a,b) -> testCase n $ encodesWithAs spaceEncodeOptions a b)
+ [ ("simple", [["abc"]], "abc\r\n")
+ , ("leadingSpace", [[" abc"]], "\" abc\"\r\n")
+ , ("comma", [["abc,def"]], "abc,def\r\n")
+ , ("space", [["abc def"]], "\"abc def\"\r\n")
+ , ("tab", [["abc\tdef"]], "\"abc\tdef\"\r\n")
+ , ("twoFields", [["abc","def"]], "abc\tdef\r\n")
+ ]
, testGroup "decode" $ map decodeTest decodeTests
, testGroup "decodeWith" $ map decodeWithTest decodeWithTests
, testGroup "streaming"

0 comments on commit 1ca1784

Please sign in to comment.