AvlTree-4.2: Balanced binary trees using the AVL algorithm.




This module contains a large set of fairly comprehensive but extremely time consuming tests of AVL tree functions (not based on QuickCheck).

They can all be run using allTests, or they can be run individually.



allTests :: IO ()Source

Run every test in this module (takes a very long time).

testReadPath :: IO ()Source

Test readPath

testIsBalanced :: IO ()Source

Test isBalanced is capable of failing for a few non-AVL trees.

testIsSorted :: IO ()Source

Test isSorted is capable of failing for a few non-sorted trees.

testSize :: IO ()Source

Test size function

testClipSize :: IO ()Source

Test clipSize function

testWrite :: IO ()Source

Test write function

testPush :: IO ()Source

Test push function

testPushL :: IO ()Source

Test pushL function Also exercises: asListL

testPushR :: IO ()Source

Test pushR function Also exercises: asListR

testDelete :: IO ()Source

Test delete function

testAssertDelL :: IO ()Source

Test assertDelL function Also exercises: asListL

testAssertDelR :: IO ()Source

Test delR function Also exercises: asListR

testAssertPopL :: IO ()Source

Test assertPopL function Also exercises: asListL

testPopHL :: IO ()Source

Test popHL function This test can only be run if popHL and HAVL are not hidden. However, popHL is exercised by indirectly by testConcatAVL anyway

testAssertPopR :: IO ()Source

Test assertPopR function Also exercises: asListR

testAssertPop :: IO ()Source

Test assertPop function

testFlatten :: IO ()Source

Test flatten function Also exercises: asListL,replicateAVL

testJoin :: IO ()Source

Test the join function

testJoinHAVL :: IO ()Source

Test the joinHAVL function

testConcatAVL :: IO ()Source

Test the concatAVL function.

testFlatConcat :: IO ()Source

Test the flatConcat function.

testFoldr :: IO ()Source

Test foldr

testFoldr' :: IO ()Source

Test foldr'

testFoldl :: IO ()Source

Test foldl

testFoldl' :: IO ()Source

Test foldl'

testFoldr1 :: IO ()Source

Test foldr1

testFoldr1' :: IO ()Source

Test foldr1'

testFoldl1 :: IO ()Source

Test foldl1

testFoldl1' :: IO ()Source

Test foldl1'

testMapAccumL :: IO ()Source

Test mapAccumL

testMapAccumR :: IO ()Source

Test mapAccumR

testMapAccumL' :: IO ()Source

Test mapAccumL'

testMapAccumR' :: IO ()Source

Test mapAccumR'

testMapAccumL'' :: IO ()Source

Test mapAccumL''

testMapAccumR'' :: IO ()Source

Test mapAccumR''

testSplitAtL :: IO ()Source

Test splitAtL function

testFilterViaList :: IO ()Source

Test the filterViaList function

testFilter :: IO ()Source

Test the filter function

testMapMaybeViaList :: IO ()Source

Test the mapMaybeViaList function

testMapMaybe :: IO ()Source

Test the mapMaybe function

testTakeL :: IO ()Source

Test takeL function

testDropL :: IO ()Source

Test dropL function

testSplitAtR :: IO ()Source

Test splitAtR function

testTakeR :: IO ()Source

Test takeR function

testDropR :: IO ()Source

Test dropR function

testSpanL :: IO ()Source

Test spanL function

testTakeWhileL :: IO ()Source

Test takeWhileL function

testDropWhileL :: IO ()Source

Test dropWhileL function

testSpanR :: IO ()Source

Test spanR function

testTakeWhileR :: IO ()Source

Test takeWhileR function

testDropWhileR :: IO ()Source

Test dropWhileR function

testRotateL :: IO ()Source

Test rotateL function

testRotateR :: IO ()Source

Test rotateR function

testRotateByL :: IO ()Source

Test rotateByL function

testRotateByR :: IO ()Source

Test rotateByR function

testForkL :: IO ()Source

Test forkL function

testForkR :: IO ()Source

Test forkR function

testFork :: IO ()Source

Test fork function

testTakeLE :: IO ()Source

Test takeLE function

testTakeGT :: IO ()Source

Test takeGT function

testTakeGE :: IO ()Source

Test takeGE function

testTakeLT :: IO ()Source

Test takeLT function

testUnion :: IO ()Source

Test the union function

testDisjointUnion :: IO ()Source

Test the disjointUnion function

testUnionMaybe :: IO ()Source

Test the unionMaybe function

testIntersection :: IO ()Source

Test the intersection function

testIntersectionMaybe :: IO ()Source

Test the intersectionMaybe function

testIntersectionAsList :: IO ()Source

Test the intersectionAsList function

testIntersectionMaybeAsList :: IO ()Source

Test the intersectionMaybeAsList function

testDifference :: IO ()Source

Test the difference function

testDifferenceMaybe :: IO ()Source

Test the differenceMaybe function

testSymDifference :: IO ()Source

Test the symDifference function

testIsSubsetOf :: IO ()Source

Test the isSubsetOf function

testIsSubsetOfBy :: IO ()Source

Test the isSubsetOfBy function

testVenn :: IO ()Source

Test the venn function. Also exercises disjointUnion

testVennMaybe :: IO ()Source

Test the vennMaybe function.

testCompareHeight :: IO ()Source

Test compareHeight function

testShowReadEq :: IO ()Source

Test Show,Read,Eq instances

testOpenClose :: IO ()Source

Test Zipper open/close

testDelClose :: IO ()Source

Test Zipper delClose

testOpenLClose :: IO ()Source

Test Zipper assertOpenL/close

testOpenRClose :: IO ()Source

Test Zipper assertOpenR/close

testMoveL :: IO ()Source

Test Zipper assertMoveL/isRightmost

testMoveR :: IO ()Source

Test Zipper assertMoveR/isLeftmost

testInsertL :: IO ()Source

Test Zipper insertL

testInsertMoveL :: IO ()Source

Test Zipper insertMoveL

testInsertR :: IO ()Source

Test Zipper insertR

testInsertMoveR :: IO ()Source

Test Zipper insertMoveR

testInsertTreeL :: IO ()Source

Test Zipper insertTreeL

testInsertTreeR :: IO ()Source

Test Zipper insertTreeR

testDelMoveL :: IO ()Source

Test Zipper assertDelMoveL

testDelMoveR :: IO ()Source

Test Zipper assertDelMoveR

testDelAllL :: IO ()Source

Test Zipper delAllL

testDelAllR :: IO ()Source

Test Zipper delAllR

testDelAllCloseL :: IO ()Source

Test Zipper delAllCloseL

testDelAllIncCloseL :: IO ()Source

Test Zipper delAllIncCloseL

testDelAllCloseR :: IO ()Source

Test Zipper delAllCloseR

testDelAllIncCloseR :: IO ()Source

Test Zipper delAllIncCloseR

testZipSize :: IO ()Source

Test Zipper sizeL/sizeR/sizeZAVL

testTryOpenLE :: IO ()Source

Test Zipper tryOpenLE

testTryOpenGE :: IO ()Source

Test Zipper tryOpenGE

testOpenEither :: IO ()Source

Test Zipper openEither (also tests fill and fillClose)

testBAVLtoZipper :: IO ()Source

Test anyBAVLtoEither