-- 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 1.0.0


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

-- | Create an expectation by saying what the result should be.
--   
--   <pre>
--   parse letterChar "" "x" `shouldParse` 'x'
--   </pre>
shouldParse :: (Ord t, ShowToken t, ShowErrorComponent e, Eq a, Show a) => Either (ParseError t 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.
--   
--   <pre>
--   parse (many punctuationChar) "" "?!!" `parseSatisfies` ((== 3) . length)
--   </pre>
parseSatisfies :: (Ord t, ShowToken t, ShowErrorComponent e, Show a) => Either (ParseError t e) a -> (a -> Bool) -> Expectation

-- | Check that a parser succeeds on a given input.
--   
--   <pre>
--   parse (char 'x') "" `shouldSucceedOn` "x"
--   </pre>
shouldSucceedOn :: (Ord t, ShowToken t, ShowErrorComponent e, Show a) => (s -> Either (ParseError t e) a) -> s -> Expectation

-- | Check that a parser fails on a given input.
--   
--   <pre>
--   parse (char 'x') "" `shouldFailOn` "a"
--   </pre>
shouldFailOn :: Show a => (s -> Either (ParseError t e) a) -> s -> Expectation

-- | Create an expectation that parser should fail producing certain
--   <a>ParseError</a>. Use the <a>err</a> function from this module to
--   construct a <a>ParseError</a> to compare with.
--   
--   <pre>
--   parse (char 'x') "" "b" `shouldFailWith` err posI (utok 'b' &lt;&gt; etok 'x')
--   </pre>
shouldFailWith :: (Ord t, ShowToken t, ShowErrorComponent e, Show a) => Either (ParseError t e) a -> ParseError t e -> Expectation

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

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

-- | Given input for parsing, construct initial state for parser (that is,
--   with empty file name, default tab width and position at 1 line and 1
--   column).
initialState :: s -> State s
