1module Test.TypeRep.Map where
3import Prelude hiding (lookup)
9-- Simple test for 'lookup', 'insert' and 'size' functions.
10spec_insertLookup :: Spec
12 describe "Lookup Test" $ do
13 it "returns the inserted element" $
14 lookup (insert 'a' empty) `shouldBe` Just 'a'
15 it "returns the second inserted value of the same type" $
16 lookup (insert 'b' $ insert 'a' empty) `shouldBe` Just 'b'
18 describe "Size Test" $ do
20 size empty `shouldBe` 0
21 it "is of size 1 when 1 element inserted" $
22 size (insert 'a' empty) `shouldBe` 1
23 it "doesn't increase size when element of the same type is added" $
24 size (insert 'b' $ insert 'a' empty) `shouldBe` 1
25 it "returns 10 when 10 different types are inserted" $
26 size mapOf10 `shouldBe` 10
30mapOf10 = insert True $ insert [True, False] $ insert (Just True)
31 $ insert (Just ()) $ insert [()] $ insert ()
32 $ insert "aaa" $ insert (Just 'a') $ insert 'a'
33 $ insert (11 :: Int) empty
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