]> gitweb.michael.orlitzky.com - hath.git/blobdiff - src/Octet.hs
Added HUnit tests to Octet.
[hath.git] / src / Octet.hs
index e2e01ea93eadbc9d72d06a522c562227596fdced..efc19d5607550e98da3bd47221fecb403e76d9e6 100644 (file)
@@ -1,5 +1,7 @@
 module Octet where
 
+import Test.HUnit
+
 import Bit
 
 -- An Octet consists of eight bits. For our purposes, the most
@@ -67,3 +69,14 @@ min_octet = Octet Zero Zero Zero Zero Zero Zero Zero Zero
 -- The octet with the greatest possible value.
 max_octet :: Octet
 max_octet = Octet One One One One One One One One
+
+
+
+-- HUnit Tests
+test_octet_from_int1 =
+    TestCase $ assertEqual "octet_from_int 128 should parse as 10000000" oct1 (octet_from_int 128)
+    where
+      oct1 = Octet One Zero Zero Zero Zero Zero Zero Zero
+
+
+octet_tests = [ test_octet_from_int1 ]