1module MultiMapSpec where
3import Network.Wai.Handler.Warp.MultiMap
5import Test.QuickCheck (property)
7type Alist = [(Int,Char)]
11 describe "fromList" $ do
12 it "generates a valid tree" $ property $ \xs ->
13 valid $ fromList (xs :: Alist)
14 describe "toSortedList" $ do
15 it "generated a sorted list" $ property $ \xs ->
16 ordered $ toSortedList $ fromList (xs :: Alist)
17 describe "search" $ do
18 it "acts as the list model" $ property $ \x xs ->
19 search x (fromList xs) == lookup x (xs :: Alist)
20 describe "fromSortedList" $ do
21 it "generates a valid tree" $ property $ \xs ->
22 valid . fromSortedList . toSortedList . fromList $ (xs :: Alist)
23 it "maintains the tree with toSortedList" $ property $ \xs ->
24 let t1 = fromList (xs :: Alist)
25 t2 = fromSortedList $ toSortedList t1
28ordered :: Ord a => [(a, b)] -> Bool
29ordered (x:y:xys) = fst x <= fst y && ordered (y:xys)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list