module Main where

import Huffman
import Test.HUnit

test_isConsistent :: IO ()
test_isConsistent = do
    assertEqual "test1_Valid_tree" True (isConsistent exercise1TreeValid)
    assertEqual "test2_Invalid_tree" False (isConsistent exercise1TreeInvalid)

test_toCodingTable :: IO ()
test_toCodingTable = pure ()

test_encode :: IO ()
test_encode = pure ()

test_decode :: IO ()
test_decode = pure ()

test_buildHTree :: IO ()
test_buildHTree = pure ()

test_toDecodeTree :: IO ()
test_toDecodeTree = pure ()

test_toFromWord8 :: IO ()
test_toFromWord8 = pure ()

test_encodeDecodeFile :: IO ()
test_encodeDecodeFile = pure ()

allTests :: Test
allTests =
  TestList
    [ mkTest "toCodingTable" test_toCodingTable
    , mkTest "encode" test_encode
    , mkTest "isConsistent" test_isConsistent
    , mkTest "decode" test_decode
    , mkTest "buildHTree" test_buildHTree
    , mkTest "toDecodeTree" test_toDecodeTree
    , mkTest "toFromWord8" test_toFromWord8
    , mkTest "encodeDecodeFile" test_encodeDecodeFile
    ]
  where
    mkTest label ass = TestLabel label (TestCase ass)

main :: IO ()
main = runTestTTAndExit allTests
