summaryrefslogtreecommitdiff
path: root/test.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-04-25 15:28:41 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-04-25 15:28:41 -0400
commit3d3abab6797d49679bfcfa4d3bb919cfc7b5f811 (patch)
tree0168728aa4228cc982a07667af62aadc1a4859c7 /test.hs
parente1bc704a9102c1a1458aceb4c43332d4e970b9e1 (diff)
move quickcheck Arbitrary declaration into test suite
So git-annex can build w/o quickcheck installed.
Diffstat (limited to 'test.hs')
-rw-r--r--test.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/test.hs b/test.hs
index 7775fb8b5..ab4766b42 100644
--- a/test.hs
+++ b/test.hs
@@ -7,6 +7,8 @@
import Test.HUnit
import Test.HUnit.Tools
+import Test.QuickCheck
+
import System.Directory
import System.Posix.Directory (changeWorkingDirectory)
import System.Posix.Files
@@ -42,6 +44,18 @@ import qualified Key
import qualified Config
import qualified Crypto
+-- for quickcheck
+instance Arbitrary Key.Key where
+ arbitrary = do
+ n <- arbitrary
+ b <- elements ['A'..'Z']
+ return $ Key.Key {
+ Key.keyName = n,
+ Key.keyBackendName = [b],
+ Key.keySize = Nothing,
+ Key.keyMtime = Nothing
+ }
+
main :: IO ()
main = do
prepare