mirror of
https://github.com/alpmestan/taggy.git
synced 2024-08-16 10:20:30 +03:00
Remove definition of shouldParse (it's in hspec-attoparsec), and dependency on hspec-expectations.
This commit is contained in:
parent
a00ddec046
commit
bee253e428
@ -68,7 +68,7 @@ test-suite spec
|
||||
base == 4.*
|
||||
, text
|
||||
, hspec
|
||||
, hspec-expectations
|
||||
, hspec-attoparsec
|
||||
, vector
|
||||
, attoparsec
|
||||
, unordered-containers
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
module Text.Taggy.ParserSpec where
|
||||
|
||||
import Control.Monad
|
||||
import Data.Attoparsec.Text.Lazy
|
||||
import Data.Text.Lazy
|
||||
import Test.Hspec
|
||||
import Test.Hspec.Attoparsec (shouldParse)
|
||||
import Text.Taggy.Parser
|
||||
import Text.Taggy.Types
|
||||
|
||||
@ -101,17 +101,3 @@ spec = do
|
||||
|
||||
(~>) :: Text -> Parser a -> Either String a
|
||||
t ~> p = eitherResult $ parse p t
|
||||
|
||||
shouldParse :: (Eq a, Show a) => Either String a -> a -> Expectation
|
||||
res `shouldParse` expectedVal =
|
||||
either (expectationFailure . errmsg)
|
||||
checkEquality
|
||||
res
|
||||
|
||||
where errmsg err = " expected: " ++ show expectedVal
|
||||
++ "\n but parse failed with error: " ++ err
|
||||
|
||||
checkEquality parsedVal =
|
||||
when (parsedVal /= expectedVal) $
|
||||
expectationFailure $ " expected: " ++ show expectedVal
|
||||
++ "\n but got: " ++ show parsedVal
|
Loading…
Reference in New Issue
Block a user