move Arbitrary instance to new Types.Transfer module

Avoid orphan instance warning
This commit is contained in:
Joey Hess 2016-09-05 14:52:06 -04:00
parent d17f08afdc
commit c9082cf0e4
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
2 changed files with 11 additions and 13 deletions

View file

@ -9,6 +9,7 @@ module Types.Transfer where
import Types
import Utility.PID
import Utility.QuickCheck
import Data.Time.Clock.POSIX
import Control.Concurrent
@ -45,3 +46,13 @@ stubTransferInfo = TransferInfo Nothing Nothing Nothing Nothing Nothing Nothing
data Direction = Upload | Download
deriving (Eq, Ord, Read, Show)
instance Arbitrary TransferInfo where
arbitrary = 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