{- How to use: $ pakcs ... Prelude> :add CurryLab testCurryLab ... if no error ... Prelude testCurryLab CurryLab> main ... it runs tests ... -} import Control.Search.SetFunctions import Data.List (nub) import TestLib import CurryLab (below, sublist, sibling) belowTests = Group ["below" ~: sortValues (set1 below 3) ~?= [0,1,2]] sublistTests = Group [ "sublist" ~: sortValues (set1 sublist [0,1,2]) ~?= [[],[0],[0,1],[0,1,2],[0,2],[1],[1,2],[2]] ] siblingDet :: String -> [String] siblingDet x = nub (sortValues (set1 sibling x)) -- nub removes duplicates. siblingTests = Group [ "Fiona" ~: siblingDet "Fiona" ~?= ["George", "Mary"] , "Frederick" ~: siblingDet "Frederick" ~?= ["Mary"] , "Henry" ~: siblingDet "Henry" ~?= [] ] tests = [belowTests, sublistTests, siblingTests] main = testlibMain tests