From ea9bf8a98dbfc40ebad2af43b6594bac0a852dcd Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 9 May 2010 15:38:53 -0400 Subject: [PATCH] Added HUnit tests to Octet. --- src/Octet.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 ] -- 2.43.2