
module Tests110
( t110
) where

import Data.Maybe
import H110

t1 =	[--Tests for problem 1
	isNothing $ myLast ([] :: [Int]),
	myLast [1] == Just 1,
	myLast [2,3,4] == Just 4,
	myLast [1..100] == Just 100
	]
t2 =	[--Tests for problem 2
	isNothing $ myButLast ([] :: [Int]),
	isNothing $ myButLast [1],
	myButLast [2,3,4] == Just 3,
	myButLast [1..100] == Just 99
	]
t3 =	[--Tests for problem 3
	isNothing $ myElementAt ([] :: [Int]) 1,
	isNothing $ myElementAt [1] 3,
	(myElementAt [1,2,3] 2) == Just 2,
	(myElementAt ['J','i','m'] 3) == Just 'm',
	(myElementAt [1..] 50) == Just 50
	]
t4 =	[--Tests for problem 4
	myLength [] == 0,
	myLength [1] == 1,
	myLength [1..100] == 100
	]
t5 =	[--Tests for problem 5
	myReverse ([] :: [Int]) == ([] :: [Int]),
	myReverse [1] == [1],
	myReverse "Jimmy" == "ymmiJ",
	myReverse [1..100] == (reverse [1..100])
	]
t6 =	[--Tests for problem 6
	isPalindrome ([] :: [Int]) == False,
	isPalindrome [1] == True,
	isPalindrome "ABBA" == True,
	isPalindrome "racecar" == True,
	isPalindrome "kayak" == True,
	isPalindrome "Jim" == False,
	isPalindrome ([1..100] ++ (myReverse [1..100])) == True
	]
t7 =	[--Tests for problem 7
	myFlatten (Elem 5) == [5],
	myFlatten (List [Elem 5, Elem 3, Elem 6]) == [5,3,6],
	myFlatten (List [Elem 7, List [Elem 3, Elem 4, List [Elem 6], Elem 1], Elem 9]) == [7,3,4,6,1,9]
	]
t8 =	[--Tests for problem 8
	myCompress ([] :: [Int]) == ([] :: [Int]),
	myCompress [1,2,3] == [1,2,3],
	myCompress "Griffen" == "Grifen",
	myCompress [1,1,1,1,1,1,1] == [1],
	myCompress ([1..100] ++ [1..100]) == [1..100]
	]
t9 =	[--Tests for problem 9
	myPack ([] :: [Int]) == ([[]] :: [[Int]]),
	myPack [1,2,3] == [[1],[2],[3]],
	myPack [1,2,2,3,3,3] == [[1],[2,2],[3,3,3]]
	]
t10 =	[--Tests for problem 10
	myEncoding [1,2,3] == [(1,1),(1,2),(1,3)],
	myEncoding [1,1,1,2,2,3] == [(3,1),(2,2),(1,3)]
	]

t110 = [t1,t2,t3,t4,t5,t6,t7,t8,t9,t10]
