on 73e7201 help sign in
20 lines 686 B history raw
1module Test.TypeRep.Vector
2 ( vectorSpec
3 ) where
5import Prelude hiding (lookup)
7import Data.Functor.Identity (Identity (..))
8import Test.Hspec (Spec, describe, it, shouldBe)
10import Data.TypeRep.Vector (TF (..), fromList, lookup)
13-- | Simple test for 'lookup', 'insert' and 'size' functions.
14vectorSpec :: Spec
15vectorSpec = describe "Vector TypeRep" $
16 describe "Lookup Test" $ do
17 it "returns the inserted element" $
18 lookup (fromList [TF (Identity 'a')]) `shouldBe` Just (Identity 'a')
19 it "returns the second inserted value of the same type" $
20 lookup (fromList [TF (Identity 'b'), TF (Identity 'a')]) `shouldBe` Just (Identity 'b')