]> gitweb.michael.orlitzky.com - hath.git/blobdiff - src/IPv4Address.hs
Use test-framework for the tests, and bump some dependencies.
[hath.git] / src / IPv4Address.hs
index b46f18c453ea967d19291810cd824a546975f5c9..dac7ddaf0596e9fba46b077d4321e88149d23b88 100644 (file)
@@ -7,8 +7,10 @@ module IPv4Address
 ) where
 
 import Data.Maybe (fromJust)
-import Test.HUnit
-import Test.QuickCheck
+import Test.HUnit (assertEqual)
+import Test.Framework (Test, testGroup)
+import Test.Framework.Providers.HUnit (testCase)
+import Test.QuickCheck (Arbitrary(..), Gen)
 
 import Maskable
 import Maskbits
@@ -304,10 +306,11 @@ mk_testaddr a b c d =
 
 test_most_sig_bit_different1 :: Test
 test_most_sig_bit_different1 =
-  TestCase $ assertEqual "10.1.1.0 and 10.1.0.0 differ in bit 24"
+  testCase desc $ assertEqual desc
              TwentyFour
              bit
   where
+    desc = "10.1.1.0 and 10.1.0.0 differ in bit 24"
     addr1 = mk_testaddr 10 1 1 0
     addr2 = (mk_testaddr 10 1 0 0)
     bit = most_sig_bit_different addr1 addr2
@@ -316,16 +319,18 @@ test_most_sig_bit_different1 =
 
 test_most_sig_bit_different2 :: Test
 test_most_sig_bit_different2 =
-  TestCase $ assertEqual "10.1.2.0 and 10.1.1.0 differ in bit 23"
+  testCase desc $ assertEqual desc
                TwentyThree
                bit
   where
+    desc = "10.1.2.0 and 10.1.1.0 differ in bit 23"
     addr1 = mk_testaddr 10 1 2 0
     addr2 = mk_testaddr 10 1 1 0
     bit = most_sig_bit_different addr1 addr2
 
 
-ipv4address_tests :: [Test]
+ipv4address_tests :: Test
 ipv4address_tests =
-  [ test_most_sig_bit_different1,
+  testGroup "IPv4 Address Tests" [
+    test_most_sig_bit_different1,
     test_most_sig_bit_different2 ]