Update dependencies for ghc-7.8.
Require a newer tasty-quickcheck that re-exports Gen.
Use lookupRDNS from newer versions of dns instead of a custom implementation.
Fix deprecation warnings in shelltests.
name: hath
-version: 0.2.0
+version: 0.2.1
cabal-version: >= 1.8
author: Michael Orlitzky
maintainer: Michael Orlitzky <michael@orlitzky.com>
Octet
build-depends:
- base >= 4.6 && < 4.7,
+ base >= 4.6 && < 4.8,
bytestring == 0.10.*,
cmdargs == 0.10.*,
dns >= 1.2,
MissingH == 1.2.*,
parallel-io == 0.3.*,
- QuickCheck == 2.7.*,
split == 0.2.*,
tasty == 0.8.*,
tasty-hunit == 0.8.*,
- tasty-quickcheck == 0.8.*
+ tasty-quickcheck >= 0.8.1
ghc-options:
-Wall
main-is: TestSuite.hs
build-depends:
- base >= 4.6 && < 4.7,
+ base >= 4.6 && < 4.8,
bytestring == 0.10.*,
cmdargs == 0.10.*,
dns >= 1.2,
MissingH == 1.2.*,
parallel-io == 0.3.*,
- QuickCheck == 2.7.*,
split == 0.2.*,
tasty == 0.8.*,
tasty-hunit == 0.8.*,
- tasty-quickcheck == 0.8.*
+ tasty-quickcheck >= 0.8.1
-- It's not entirely clear to me why I have to reproduce all of this.
main-is: ShellTests.hs
build-depends:
- base >= 4.6 && < 4.7,
+ base >= 4.6 && < 4.8,
bytestring == 0.10.*,
cmdargs == 0.10.*,
dns >= 1.2,
MissingH == 1.2.*,
parallel-io == 0.3.*,
- process == 1.1.*,
- QuickCheck == 2.7.*,
+ process < 1.3,
split == 0.2.*,
tasty == 0.8.*,
tasty-hunit == 0.8.*,
- tasty-quickcheck == 0.8.*
+ tasty-quickcheck >= 0.8.1
-- It's not entirely clear to me why I have to reproduce all of this.
ghc-options:
main-is: ShellTestsNet.hs
build-depends:
- base >= 4.6 && < 4.7,
+ base >= 4.6 && < 4.8,
bytestring == 0.10.*,
cmdargs == 0.10.*,
dns >= 1.2,
MissingH == 1.2.*,
parallel-io == 0.3.*,
- process == 1.1.*,
- QuickCheck == 2.7.*,
+ process < 1.3,
split == 0.2.*,
tasty == 0.8.*,
tasty-hunit == 0.8.*,
- tasty-quickcheck == 0.8.*
+ tasty-quickcheck >= 0.8.1
-- It's not entirely clear to me why I have to reproduce all of this.
ghc-options:
import Data.List.Split (splitOneOf)
import Data.Maybe (catMaybes, mapMaybe)
-import Test.QuickCheck ( Gen ) -- Not re-exported by tasty
import Test.Tasty ( TestTree, testGroup )
import Test.Tasty.HUnit ( (@?=), testCase )
import Test.Tasty.QuickCheck (
Arbitrary(..),
+ Gen,
Property,
(==>),
testProperty )
where
import Control.Concurrent.ParallelIO.Global ( parallel )
-import qualified Data.ByteString.Char8 as BS (
- append,
- intercalate,
- pack,
- split )
import Network.DNS (
Domain,
DNSError,
ResolvConf(..),
defaultResolvConf,
- lookupPTR,
+ lookupRDNS,
makeResolvSeed,
withResolver )
--- The return type of lookupPTR.
+-- The return type of lookupRDNS.
type PTRResult = Either DNSError [Domain]
--- | Convert the given IP address (as a ByteString) to the format
--- required for a PTR lookup. For example, "192.168.0.0" should be
--- converted to "0.0.168.192.in-addr.arpa".
-ip_to_in_addr_arpa :: Domain -> Domain
-ip_to_in_addr_arpa ip =
- rev_ip `BS.append` suffix
- where
- dot = BS.pack "."
- suffix = BS.pack ".in-addr.arpa"
- rev_ip = BS.intercalate dot (reverse (BS.split '.' ip))
-
-- | Take the default ResolvConf and increase the timeout to 15
-- seconds.
our_resolv_conf :: ResolvConf
lookup_ptrs ips = do
rs <- makeResolvSeed our_resolv_conf
let lookup' addr = withResolver rs $ \resolver ->
- lookupPTR resolver addr
-
- parallel $ map lookup' in_addrs
+ lookupRDNS resolver addr
- where
- in_addrs = map ip_to_in_addr_arpa ips
+ parallel $ map lookup' ips
where
-import Test.QuickCheck ( Gen ) -- Not re-exported by tasty
import Test.Tasty ( TestTree, testGroup )
import Test.Tasty.HUnit ( (@?=), testCase )
import Test.Tasty.QuickCheck (
Arbitrary(..),
+ Gen,
Property,
(==>),
testProperty )
octet_tests )
where
-import Test.QuickCheck ( Gen ) -- Not re-exported by tasty
import Test.Tasty ( TestTree, testGroup )
import Test.Tasty.HUnit ( (@?=), testCase )
import Test.Tasty.QuickCheck (
Arbitrary(..),
+ Gen,
Property,
(==>),
testProperty )
module Main
where
-import System.Cmd ( system )
+import System.Process ( system )
import System.Exit ( exitWith )
main :: IO ()
module Main
where
-import System.Cmd ( system )
+import System.Process ( system )
import System.Exit ( exitWith )
main :: IO ()