{- Testing of the xor functions

This function implements an IO program for testing an xor function
such as the one to be implements in exercise 1 of section 5.7 of the
Notes on Functional Programming with Haskell.

Items to note:
- "do" introducing a sequence of IO calls within the IO monad
- show to convert a value to a string
- putStr to output a string
- putStrLn to output a string followed by a newline
- choice of 4 test cases to cover the possibilities

-}

test_xor = 
  do
     putStr "xor True  True  = "
     putStrLn (show (xor True True))
     putStr "Success:  "
     putStrLn (show (xor True True == False))
     putStr "xor True  False = "
     putStrLn (show (xor True False))
     putStr "Success:  "
     putStrLn (show (xor True False == True))
     putStr "xor False True  = "
     putStrLn (show (xor False True))
     putStr "Success:  "
     putStrLn (show (xor False True == True))
     putStr "xor False False = "   
     putStrLn (show (xor False False))
     putStr "Success:  "
     putStrLn (show (xor False False == False))

