implemented posSearchExact
This commit is contained in:
@@ -30,6 +30,7 @@ import Mtlstats.Types
|
||||
spec :: Spec
|
||||
spec = describe "Position" $ do
|
||||
posSearchSpec
|
||||
posSearchExactSpec
|
||||
getPositionsSpec
|
||||
|
||||
posSearchSpec :: Spec
|
||||
@@ -48,6 +49,21 @@ posSearchSpec = describe "posSearch" $ mapM_
|
||||
)
|
||||
]
|
||||
|
||||
posSearchExactSpec :: Spec
|
||||
posSearchExactSpec = describe "posSearchExact" $ mapM_
|
||||
(\(input, expected) -> context ("input: " ++ show input) $
|
||||
it ("should be " ++ show expected) $
|
||||
posSearchExact input db `shouldBe` expected)
|
||||
|
||||
-- input, expected
|
||||
[ ( "foo", Just 2 )
|
||||
, ( "FOO", Nothing )
|
||||
, ( "bar", Just 0 )
|
||||
, ( "baz", Just 1 )
|
||||
, ( "a", Nothing )
|
||||
, ( "quux", Nothing )
|
||||
]
|
||||
|
||||
getPositionsSpec :: Spec
|
||||
getPositionsSpec = describe "getPositions" $ let
|
||||
expected = ["bar", "baz", "foo"]
|
||||
|
||||
Reference in New Issue
Block a user