on 73e7201 help sign in
20 lines 725 B history raw
1module Test.TypeRep.VectorOpt
2 ( optimalVectorSpec
3 ) where
5import Prelude hiding (lookup)
7import Data.Functor.Identity (Identity (..))
8import Test.Hspec (Spec, describe, it, shouldBe)
10import Data.TypeRep.OptimalVector (TF (..), fromList, lookup)
13-- | Simple test for 'lookup', 'insert' and 'size' functions.
14optimalVectorSpec :: Spec
15optimalVectorSpec = describe "Optimal 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')