import Test.Tasty ( TestTree, testGroup )
import Test.Tasty.HUnit ( (@?=), testCase )
import Test.Tasty.QuickCheck (
- Arbitrary(..),
+ Arbitrary( arbitrary ),
Gen,
Property,
(==>),
import Text.Read (readMaybe)
import qualified Bit as B (Bit(..))
-import IPv4Address (IPv4Address(..), most_sig_bit_different)
-import Maskable (Maskable(..))
-import Maskbits (Maskbits(..))
-import Octet (Octet(..))
+import IPv4Address (
+ IPv4Address( IPv4Address, octet1, octet2, octet3, octet4 ),
+ most_sig_bit_different )
+import Maskable (Maskable(apply_mask))
+import Maskbits ( Maskbits(Zero) )
+import Octet (Octet())
data Cidr = Cidr { ipv4address :: IPv4Address,
import Test.Tasty ( TestTree, testGroup )
import Test.Tasty.HUnit ( (@?=), testCase )
import Test.Tasty.QuickCheck (
- Arbitrary(..),
+ Arbitrary( arbitrary ),
Gen,
Property,
(==>),
testProperty )
-import Maskable (Maskable(..))
-import Maskbits (Maskbits(..))
-import Octet (Octet(..))
+import Maskable ( Maskable( apply_mask) )
+import Maskbits (
+ Maskbits(
+ Zero, One, Two, Three, Four, Five, Six, Seven, Eight,
+ Nine, Ten, Eleven, Twelve, Thirteen, Fourteen, Fifteen, Sixteen,
+ Seventeen, Eighteen, Nineteen, Twenty, TwentyOne, TwentyTwo, TwentyThree,
+ TwentyFour, TwentyFive, TwentySix, TwentySeven, TwentyEight, TwentyNine,
+ Thirty, ThirtyOne, ThirtyTwo ) )
+import Octet ( Octet( b1, b2, b3, b4, b5, b6, b7, b8) )
data IPv4Address =
IPv4Address { octet1 :: Octet,
min_octet2,
min_octet3,
min_octet4 )
-import CommandLine (Args(..), get_args)
+import CommandLine(
+ Args( Regexed, Reduced, Duped, Diffed, Listed, barriers ),
+ get_args )
import ExitCodes ( exit_invalid_cidr )
import Octet ()
Maskbits(..) )
where
-import Test.Tasty.QuickCheck ( Arbitrary(..), elements )
+import Test.Tasty.QuickCheck ( Arbitrary(arbitrary), elements )
-- | A type representing the number of bits in a CIDR netmask.
import Test.Tasty ( TestTree, testGroup )
import Test.Tasty.HUnit ( (@?=), testCase )
import Test.Tasty.QuickCheck (
- Arbitrary(..),
+ Arbitrary( arbitrary ),
Gen,
Property,
(==>),
testProperty )
-import Bit as B (Bit(..))
-import Maskable (Maskable(..))
-import Maskbits (Maskbits(..))
+import Bit as B( Bit( Zero, One) )
+import Maskable( Maskable( apply_mask) )
+import Maskbits(
+ Maskbits( Zero, One, Two, Three, Four, Five, Six, Seven, Eight ) )
-- | An Octet consists of eight bits. For our purposes, the most
-- significant bit will come "first." That is, b1 is in the 2^7
-import Test.Tasty ( TestTree, defaultMain, localOption, testGroup )
-import Test.Tasty.QuickCheck ( QuickCheckTests(..), QuickCheckMaxRatio(..) )
-import Cidr ( cidr_properties, cidr_tests )
-import IPv4Address ( ipv4address_properties, ipv4address_tests )
-import Octet ( octet_properties, octet_tests )
+import Test.Tasty( TestTree, defaultMain, localOption, testGroup )
+import Test.Tasty.QuickCheck(
+ QuickCheckTests( QuickCheckTests),
+ QuickCheckMaxRatio( QuickCheckMaxRatio ))
+import Cidr( cidr_properties, cidr_tests )
+import IPv4Address( ipv4address_properties, ipv4address_tests )
+import Octet( octet_properties, octet_tests )
tests :: TestTree
tests = testGroup "All Tests" [