From: Michael Orlitzky Date: Sun, 9 May 2010 19:38:53 +0000 (-0400) Subject: Added HUnit tests to Octet. X-Git-Tag: 0.0.1~51 X-Git-Url: http://gitweb.michael.orlitzky.com/?p=hath.git;a=commitdiff_plain;h=ea9bf8a98dbfc40ebad2af43b6594bac0a852dcd Added HUnit tests to Octet. --- diff --git a/src/Octet.hs b/src/Octet.hs index e2e01ea..efc19d5 100644 --- a/src/Octet.hs +++ b/src/Octet.hs @@ -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 ]