summaryrefslogtreecommitdiff
path: root/Test.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-02-27 21:42:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-02-27 21:42:07 -0400
commitca59b87b11c01c417a7b3b8f0cf15426e6fadcfb (patch)
tree36c342a8ae999986aabf51d6a3371515e9ac1dfd /Test.hs
parentf54b34a6e6cb000d3117106fd19c13ef9dc7f38f (diff)
move Arbitrary instances out of Test and into modules that define the types
This is possible now that we build-depend on QuickCheck.
Diffstat (limited to 'Test.hs')
-rw-r--r--Test.hs34
1 files changed, 0 insertions, 34 deletions
diff --git a/Test.hs b/Test.hs
index eeba44dbb..11ab33e92 100644
--- a/Test.hs
+++ b/Test.hs
@@ -5,13 +5,10 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-{-# OPTIONS_GHC -fno-warn-orphans #-}
-
module Test where
import Test.HUnit
import Test.HUnit.Tools
-import Test.QuickCheck
import Test.QuickCheck.Instances ()
import System.Posix.Directory (changeWorkingDirectory)
@@ -58,37 +55,6 @@ import qualified Utility.Process
import qualified Utility.Misc
import qualified Utility.InodeCache
--- instances for quickcheck
-instance Arbitrary Types.Key.Key where
- arbitrary = Types.Key.Key
- <$> arbitrary
- <*> (listOf1 $ elements ['A'..'Z']) -- BACKEND
- <*> ((abs <$>) <$> arbitrary) -- size cannot be negative
- <*> arbitrary
-
-instance Arbitrary Logs.Transfer.TransferInfo where
- arbitrary = Logs.Transfer.TransferInfo
- <$> arbitrary
- <*> arbitrary
- <*> pure Nothing -- cannot generate a ThreadID
- <*> pure Nothing -- remote not needed
- <*> arbitrary
- -- associated file cannot be empty (but can be Nothing)
- <*> arbitrary `suchThat` (/= Just "")
- <*> arbitrary
-
-instance Arbitrary Utility.InodeCache.InodeCache where
- arbitrary = Utility.InodeCache.InodeCache
- <$> arbitrary
- <*> arbitrary
- <*> arbitrary
-
-instance Arbitrary Logs.Presence.LogLine where
- arbitrary = Logs.Presence.LogLine
- <$> arbitrary
- <*> elements [minBound..maxBound]
- <*> arbitrary `suchThat` ('\n' `notElem`)
-
main :: IO ()
main = do
prepare