summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-12-03 19:06:33 +0300
committerdefanor <defanor@uberspace.net>2017-12-03 19:06:33 +0300
commit2dfe2f8648a6748234514bcd9d61e5e1a1d1fb72 (patch)
treed4a80b112a836c153eefcbd63d25e3eeb02e8d7d /test
parentac125877105ed69fd0a198a09c331f16124751f3 (diff)
Refactor
Add annotations, fix -Wall warnings, lint, etc.
Diffstat (limited to 'test')
-rw-r--r--test/Test.hs6
1 files changed, 3 insertions, 3 deletions
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"