packages feed

from-1.0.0.1: test/Main.hs

module Main (main) where

import Data.Int
import Data.Word
import From
import System.Exit

assertEq :: (Eq term) => String -> term -> term -> IO ()
assertEq comment leftTerm rightTerm
  | leftTerm == rightTerm = report
  | otherwise = report >> exitFailure
 where
  report = putStrLn comment

-- TODO: More test cases
main :: IO ()
main = do
  assertEq
    "round trip from Int8 to Word32"
    (0x11 :: Int8)
    (from (from (0x11 :: Int8) :: Word32))