From 2dfe2f8648a6748234514bcd9d61e5e1a1d1fb72 Mon Sep 17 00:00:00 2001 From: defanor Date: Sun, 3 Dec 2017 19:06:33 +0300 Subject: Refactor Add annotations, fix -Wall warnings, lint, etc. --- test/Test.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/Test.hs b/test/Test.hs index 28d67ee..5002263 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -1,6 +1,5 @@ {-# LANGUAGE DeriveGeneric #-} -import Text.Megaparsec import GHC.Generics import Generic.Random import Test.Tasty @@ -78,9 +77,9 @@ instance ArgParser NestedSum instance ToArgs NestedSum instance Arbitrary NestedSum where arbitrary = genericArbitraryU -printAndParse :: (ArgParser a, ToArgs a, Eq a, Show a, Arbitrary a) +printAndParse :: (ArgParser a, ToArgs a, Eq a) => Proxy a -> a -> Bool -printAndParse _ r = Right r == parse (argParser defMod) "test" (toArgs defMod r) +printAndParse _ r = Right r == fromArgs defMod (toArgs defMod r) mkTest :: (ArgParser a, ToArgs a, Eq a, Show a, Arbitrary a) => Proxy a -> String -> TestTree @@ -89,6 +88,7 @@ mkTest p n = QC.testProperty ("id == parse . print for " ++ n) (printAndParse p) main :: IO () main = travisTestReporter defaultConfig [] qcProps +qcProps :: TestTree qcProps = testGroup "Quickcheck properties" [ mkTest (Proxy :: Proxy Basic) "Basic" , mkTest (Proxy :: Proxy WithLists) "WithLists" -- cgit v1.2.3