]> gitweb.michael.orlitzky.com - hath.git/blobdiff - src/Octet.hs
Rename the "octet_from_int" test; that function is gone.
[hath.git] / src / Octet.hs
index fa004c5085df4849a4b2ff44033106d10fd90193..34f9d4f821e61997ccbdb2f1438c10a06c71b49a 100644 (file)
@@ -7,15 +7,16 @@ where
 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
@@ -153,7 +154,7 @@ instance Read Octet where
 octet_tests :: TestTree
 octet_tests =
   testGroup "Octet Tests" [
-    test_octet_from_int1,
+    test_octet_to_enum1,
     test_octet_mask1,
     test_octet_mask2 ]
 
@@ -189,11 +190,11 @@ prop_read_show_inverses =
 
 
 -- HUnit Tests
-test_octet_from_int1 :: TestTree
-test_octet_from_int1 =
+test_octet_to_enum1 :: TestTree
+test_octet_to_enum1 =
   testCase desc $ actual @?= expected
   where
-    desc = "octet_from_int 128 should parse as 10000000"
+    desc = "toEnum 128 should parse as 10000000"
     expected = Octet B.One B.Zero B.Zero B.Zero B.Zero B.Zero B.Zero B.Zero
     actual = toEnum 128 :: Octet