Advertisement
Guest User

Untitled

a guest
Oct 11th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. test1 = TestCase (assertEqual "The output should be True" True (c_all (>0) [1, 2, 3, 4, 5, 6, 7]))
  2. test2 = TestCase (assertEqual "The output should be False" False (c_all (=="is") ["Haskell", "is", "not", "easy"]))
  3. test3 = TestCase (assertEqual "The output should be False" True (c_all (>0) EmptyTree))
  4. test4 = TestCase (assertEqual "The output should be True" True (c_all (>0) (Node 5 (Node 2 (Node 7 EmptyTree EmptyTree) (Node 7 EmptyTree EmptyTree)) (Node 7 (Node 7 EmptyTree EmptyTree) (Node 7 EmptyTree EmptyTree)))))
  5. -- test5 = TestCase (assertEqual "The output should be 7" 7 (c_max para_max [1, 3, 5, 7]))
  6. -- test6 = TestCase (assertEqual "The output should be zzzzzzz" "zzzzzzz" (c_max para_max ["a", "zzzzzzz", "bc", "ddd"]))
  7. -- test7 = TestCase (assertEqual "The output should be 7" 7 (c_max para_max (Node 7 (Node 1 EmptyTree EmptyTree) (Node 2 EmptyTree EmptyTree))))
  8. -- test8 = TestCase (assertEqual "The output should be an EmptyTree" EmptyTree (c_max para_max EmptyTree))
  9.  
  10. -- tests = TestList [TestLabel "all_list_int" test1, TestLabel "all_list_char" test2, TestLabel "all_tree1" test3, TestLabel "all_tree2" test4, TestLabel "max_list_int" test5, TestLabel "max_list_char" test6, TestLabel "max_tree1" test7, TestLabel "max_tree2" test8]
  11. tests = TestList [TestLabel "all_list_int" test1, TestLabel "all_list_char" test2, TestLabel "all_tree1" test3, TestLabel "all_tree2" test4]
  12. myTest = runTestTT tests
  13. main :: IO Counts
  14. main = myTest
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement