-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Utility functions for testing Megaparsec parsers with Hspec
--   
--   Utility functions for testing Megaparsec parsers with Hspec.
@package hspec-megaparsec
@version 2.2.0

-- | Utility functions for testing Megaparsec parsers with Hspec.
module Test.Hspec.Megaparsec

-- | Create an expectation by saying what the result should be.
--   
--   
--   parse letterChar "" "x" `shouldParse` 'x'
--   
shouldParse :: (HasCallStack, ShowErrorComponent e, Stream s, VisualStream s, TraversableStream s, Show a, Eq a) => Either (ParseErrorBundle s e) a -> a -> Expectation

-- | Create an expectation by saying that the parser should successfully
--   parse a value and that the value should satisfy some predicate.
--   
--   
--   parse (many punctuationChar) "" "?!!" `parseSatisfies` ((== 3) . length)
--   
parseSatisfies :: (HasCallStack, ShowErrorComponent e, Stream s, VisualStream s, TraversableStream s, Show a, Eq a) => Either (ParseErrorBundle s e) a -> (a -> Bool) -> Expectation

-- | Check that a parser succeeds on a given input.
--   
--   
--   parse (char 'x') "" `shouldSucceedOn` "x"
--   
shouldSucceedOn :: (HasCallStack, ShowErrorComponent e, Stream s, VisualStream s, TraversableStream s, Show a) => (s -> Either (ParseErrorBundle s e) a) -> s -> Expectation

-- | Check that a parser fails on a given input.
--   
--   
--   parse (char 'x') "" `shouldFailOn` "a"
--   
shouldFailOn :: (HasCallStack, Show a) => (s -> Either (ParseErrorBundle s e) a) -> s -> Expectation

-- | Create an expectation that parser should fail producing certain
--   ParseError. Use the err function from this module to
--   construct a ParseError to compare with.
--   
--   
--   parse (char 'x') "" "b" `shouldFailWith` err posI (utok 'b' <> etok 'x')
--   
shouldFailWith :: (HasCallStack, ShowErrorComponent e, Stream s, VisualStream s, TraversableStream s, Show a, Eq e) => Either (ParseErrorBundle s e) a -> ParseError s e -> Expectation

-- | Similar to shouldFailWith, but allows to check parsers that can
--   report more than one parse error at a time.
shouldFailWithM :: (HasCallStack, ShowErrorComponent e, Stream s, VisualStream s, TraversableStream s, Show a, Eq e) => Either (ParseErrorBundle s e) a -> [ParseError s e] -> Expectation

-- | Check that a parser fails and leaves a certain part of input
--   unconsumed. Use it with functions like runParser' and
--   runParserT' that support incremental parsing.
--   
--   
--   runParser' (many (char 'x') <* eof) (initialState "xxa")
--     `failsLeaving` "a"
--   
--   
--   See also: initialState.
failsLeaving :: (HasCallStack, Show a, Eq s, Show s) => (State s e, Either (ParseErrorBundle s e) a) -> s -> Expectation

-- | Check that a parser succeeds and leaves certain part of input
--   unconsumed. Use it with functions like runParser' and
--   runParserT' that support incremental parsing.
--   
--   
--   runParser' (many (char 'x')) (initialState "xxa")
--     `succeedsLeaving` "a"
--   
--   
--   See also: initialState.
succeedsLeaving :: (HasCallStack, Show a, Eq s, Show s, ShowErrorComponent e, Stream s, VisualStream s, TraversableStream s) => (State s e, Either (ParseErrorBundle s e) a) -> s -> Expectation

-- | Given input for parsing, construct initial state for parser.
initialState :: s -> State s e

-- | Given input for parsing, construct initial positional state.
initialPosState :: s -> PosState s
