summaryrefslogtreecommitdiffstats
path: root/test/Test.hs
diff options
context:
space:
mode:
Diffstat (limited to 'test/Test.hs')
-rw-r--r--test/Test.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/Test.hs b/test/Test.hs
index 8ef6a3a..0836220 100644
--- a/test/Test.hs
+++ b/test/Test.hs
@@ -67,7 +67,7 @@ instance Arbitrary NestedSum where arbitrary = genericArbitraryU
data RecursiveRecordMaybe = RecursiveRecordMaybe
{ rrm :: Maybe RecursiveRecordMaybe
, record :: Maybe Record
- , guard :: ()
+ , guard :: Word8
} deriving (Generic, Eq, Show, Coalpit)
instance Arbitrary RecursiveRecordMaybe where arbitrary = genericArbitraryU
@@ -75,7 +75,7 @@ data RecursiveRecordMaybe2 = RecursiveRecordMaybe2
{ record1' :: Maybe Record
, rrm' :: Maybe (Maybe RecursiveRecordMaybe2)
, record2' :: Maybe Record
- , guard' :: ()
+ , guard' :: Word8
} deriving (Generic, Eq, Show, Coalpit)
instance Arbitrary RecursiveRecordMaybe2 where arbitrary = genericArbitraryU
@@ -96,7 +96,7 @@ printAndParseDSV :: (Coalpit a, Eq a)
=> Options -> Proxy a -> (a, Int) -> Bool
printAndParseDSV opt _ (x, n) =
let xs = (replicate (n `mod` 3) x)
- in xs == rights (readDSV opt (showDSV opt xs))
+ in xs == (rights . map (readDSV opt) . lines . unlines . map (showDSV opt) $ xs)
variousTypes :: (forall a. (Coalpit a, Eq a, Show a, Arbitrary a) =>
@@ -135,7 +135,8 @@ qcProps = testGroup "Quickcheck properties"
[ testGroup "Right == fromArgs opt . toArgs opt"
(variousOptions $ \opt ->
variousTypes $ \p n -> QC.testProperty n (printAndParse opt p))
- , testGroup "id == rights . readDSV opt . showDSV opt"
+ , testGroup
+ "id == rights . map (readDSV opt) . lines . unlines . map (showDSV opt)"
(variousOptions $ \opt ->
variousTypes $ \p n -> QC.testProperty n (printAndParseDSV opt p))
]