summaryrefslogtreecommitdiff
path: root/tests/Config.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-01-01 01:10:44 -0500
committerjoe <joe@jerkface.net>2017-01-01 01:10:44 -0500
commit80c860df8c29f99e0a82b454c1c0f0c6902764ef (patch)
treeafb7a07440b308179252f7e5a79cc85870705358 /tests/Config.hs
parentb0cb559c503e791c2a2297a6316d59dab6c49202 (diff)
Fixed build of testsuite.
Diffstat (limited to 'tests/Config.hs')
-rw-r--r--tests/Config.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/Config.hs b/tests/Config.hs
index 9ffb0d8c..55e30867 100644
--- a/tests/Config.hs
+++ b/tests/Config.hs
@@ -1,3 +1,4 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE RecordWildCards #-} 2{-# LANGUAGE RecordWildCards #-}
2module Config 3module Config
3 ( -- * Types 4 ( -- * Types
@@ -39,8 +40,10 @@ import Network.BitTorrent.Address (IP, PeerAddr (PeerAddr), genPeerId)
39type ClientName = String 40type ClientName = String
40 41
41 42
43#if !MIN_VERSION_network(2,6,3)
42instance Read PortNumber where 44instance Read PortNumber where
43 readsPrec = error "readsPrec" 45 readsPrec = error "readsPrec"
46#endif
44 47
45data ClientOpts = ClientOpts 48data ClientOpts = ClientOpts
46 { peerPort :: PortNumber -- tcp port 49 { peerPort :: PortNumber -- tcp port
@@ -64,13 +67,13 @@ defThisOpts = def
64 67
65clientOptsParser :: Parser ClientOpts 68clientOptsParser :: Parser ClientOpts
66clientOptsParser = ClientOpts 69clientOptsParser = ClientOpts
67 <$> option 70 <$> option auto
68 ( long "peer-port" <> short 'p' 71 ( long "peer-port" <> short 'p'
69 <> value 6881 <> showDefault 72 <> value 6881 <> showDefault
70 <> metavar "NUM" 73 <> metavar "NUM"
71 <> help "port to bind the specified bittorrent client" 74 <> help "port to bind the specified bittorrent client"
72 ) 75 )
73 <*> option 76 <*> option auto
74 ( long "node-port" <> short 'n' 77 ( long "node-port" <> short 'n'
75 <> value 6881 <> showDefault 78 <> value 6881 <> showDefault
76 <> metavar "NUM" 79 <> metavar "NUM"
@@ -177,4 +180,4 @@ getOpts = do
177 exitFailure 180 exitFailure
178 181
179 writeIORef envOptsRef envOpts 182 writeIORef envOptsRef envOpts
180 return (envOpts, hspecOpts) \ No newline at end of file 183 return (envOpts, hspecOpts)