--
-- postscreen_dnsbl_sites = bl.mailspike.net=127.0.0.[2;10;11]*2, ...
--
--- Here, the 'Domain' is \"bl.mailspike.net\", the return code
--- pattern is \"127.0.0.[2;10;11]\", and the weight is \"2".
+-- Here, the blacklist (a 'UserDomain') is \"bl.mailspike.net\", the
+-- return code pattern is \"127.0.0.[2;10;11]\", and the weight is
+-- \"2".
--
-module DnsblSite
+module DnsblSite ()
where
import Text.Parsec (
import Text.Parsec.String ( Parser )
import Text.Read ( readMaybe )
-
+import Domain ( UserDomain )
import IPv4Pattern ( IPv4Pattern )
newtype Weight = Weight Int deriving (Eq, Show)
Nothing -> unexpected "weight: readMaybe failed on a sequence of digits!"
Just k -> return $ Weight (if sign == '-' then negate k else k)
-newtype Domain = Domain String
-
-data DnsblSite = DnsblSite Domain IPv4Pattern Weight
+data DnsblSite = DnsblSite UserDomain IPv4Pattern Weight
-- v4sequence = v4seq_member | v4sequence ";" v4seq_member
-- v4seq_member = v4octet | v4octet ".." v4octet
--
-module IPv4Pattern
+module IPv4Pattern (
+ IPv4Pattern,
+ addresses,
+ ipv4pattern_tests,
+ v4pattern)
where
-- * Tests
+ipv4pattern_tests :: TestTree
+ipv4pattern_tests =
+ testGroup "IPv4Pattern Tests" [ v4octet_tests ]
+
+
v4octet_tests :: TestTree
v4octet_tests =
testGroup
import Test.Tasty ( TestTree, defaultMain, testGroup )
-import IPv4Pattern ( v4octet_tests )
+import IPv4Pattern ( ipv4pattern_tests )
tests :: TestTree
-tests = testGroup "All Tests" [ v4octet_tests ]
+tests = testGroup "All Tests" [ ipv4pattern_tests ]
main :: IO ()
main = defaultMain tests