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


-- | Tiny QuickCheck test library with minimal dependencies
--   
--   A tiny (1 module, &lt;500 lines) property-based (and unit) testing
--   library with minimal dependencies.
--   
--   Instead of reinventing the wheel (<a>https://xkcd.com/927</a>), we use
--   a RSpec/HSpec-like DSL and run tests with QuickCheck.
--   
--   For many use-cases, microspec is a drop-in replacement for hspec.
--   
--   <pre>
--   import Test.Microspec
--   
--   main :: IO ()
--   main = microspec $ do
--      describe "replicate" $ do
--         it "doubles with 2" $
--            replicate 2 'x' === "xx"
--         it "creates a list of the right size" $
--            \(Positive n) -&gt; length (replicate n 'x') === n
--   
--      describe "reverse" $ do
--         it "reverse . reverse === id" $ \l -&gt;
--            reverse (reverse l) === (l :: [Int])
--   
--      describe "tail" $
--         it "length is -1" $ \(NonEmpty l) -&gt;
--            length (tail l :: [Int]) === length l - 1
--   
--      describe "solve the halting problem" $
--         pending
--   </pre>
@package microspec
@version 0.2.1.3


-- | Tests can be structured as nested <a>it</a> / <a>describe</a>
--   statements
--   
--   E.g.
--   
--   <pre>
--   microspec $ do
--      describe "plus" $ do
--         it "adds positive numbers" $ do
--            it "does 1 + 1" $
--               1 + 1 === 2
--            it "does 2 + 2" $
--               2 + 2 === 4
--         it "is commutative" $
--            \x y -&gt; x + y === y + (x :: Int)
--   </pre>
--   
--   ...which will return, nicely in green instead of bold:
--   
--   <pre>
--   plus
--     adds positive numbers
--       <b>does 1 + 1</b>
--       <b>does 2 + 2</b>
--     <b>is commutative</b>
--   
--     -----
--   Runtime: 0.00943336s
--   <b>Successes: 3, Pending: 0, Failures: 0</b>
--   
--   </pre>
module Test.Microspec

-- | Run your spec. Put this at the top level, e.g.:
--   
--   <pre>
--   main = microspec $ do
--      describe "plus 1" $
--         3 + 1 === 4
--   </pre>
microspec :: Microspec () -> IO ()

-- | <a>microspec</a> with <a>MArgs</a>
microspecWith :: MArgs -> Microspec () -> IO ()

-- | Describe a test, e.g.:
--   
--   <pre>
--   describe "reverse 'foo' is 'oof'" $
--      reverse "foo" === "oof"
--   </pre>
describe :: MTestable t => String -> t -> Microspec ()

-- | An alias for <a>describe</a>. Usually used inside a <a>describe</a>
--   block:
--   
--   <pre>
--   describe "replicate" $ do
--      it "doubles with 2" $
--         replicate 2 'x' === "xx"
--      it "creates a list of the right size" $
--         \(Positive n) -&gt; length (replicate n 'x') === n
--   </pre>
it :: MTestable t => String -> t -> Microspec ()

-- | Describe a test as unwritten, e.g.:
--   
--   <pre>
--   describe "meaning of life" $ pending
--   </pre>
pending :: Pending

-- | Note that you don't need to use this to create a test, e.g.:
--   
--   <pre>
--   describe "reverse preserves length" $
--      \l -&gt; length (reverse l) === length l
--   </pre>
prop :: MTestable prop => String -> prop -> Microspec ()

-- | A series of tests, to run with <a>microspec</a>
data Microspec a

-- | Something which can be tested
--   
--   Note both Bools and Properties can be tested, but only Properties show
--   the values that weren't equal
--   
--   For both unit tests and property tests, if you want to see the outputs
--   of failed tests use <a>===</a>. If you just want to test for equality,
--   use <a>==</a>.
--   
--   For example, the outputs of running:
--   
--   <pre>
--   microspec $ do
--      describe "baddies" $ do
--         it "isn't 1 =="  $ 0 == (1 :: Int)
--         it "isn't 1 ===" $ 0 === (1 :: Int)
--         it "isn't always 1 =="  $ x -&gt; x == (1 :: Int)
--         it "isn't always 1 ===" $ x -&gt; x === (1 :: Int)
--   
--   </pre>
--   
--   are:
--   
--   <pre>
--   isn't 1 == - *** Failed! Falsifiable (after 1 test)
--   isn't 1 === - *** Failed! Falsifiable (after 1 test):  | 0 /= 1
--   isn't always 1 == - *** Failed! Falsifiable (after 1 test):  | 0
--   isn't always 1 === - *** Failed! Falsifiable (after 1 test):  | 0 | 0 /= 1
--   
--   </pre>
class MTestable t

-- | Tweak how tests are run, with <a>microspecWith</a>.
data MArgs
MArgs :: Maybe Double -> Args -> MArgs

-- | Number of seconds before each test times out. If you want to do this
--   on a per-test basis, try <a>within</a>
[_mArgs_timeoutSecs] :: MArgs -> Maybe Double

-- | Arguments to use with QuickCheck tests
[_mArgs_qcArgs] :: MArgs -> Args

-- | Default arguments. Calling "microspec" is the same as calling
--   "microspecWith defaultMArgs".
defaultMArgs :: MArgs

-- | Hspec compatibility. Equivalent to using <a>===</a>
shouldBe :: (Eq x, Show x) => x -> x -> Property

shouldSatisfy :: Show x => x -> (x -> Bool) -> Property
instance GHC.Internal.Base.Applicative Test.Microspec.Microspec
instance GHC.Internal.Base.Functor Test.Microspec.Microspec
instance Test.Microspec.MTestable GHC.Types.Bool
instance (Test.QuickCheck.Arbitrary.Arbitrary a, GHC.Internal.Show.Show a, Test.QuickCheck.Property.Testable prop) => Test.Microspec.MTestable (a -> prop)
instance Test.Microspec.MTestable (Test.Microspec.Microspec ())
instance Test.Microspec.MTestable Test.Microspec.Pending
instance Test.Microspec.MTestable Test.QuickCheck.Property.Property
instance Test.Microspec.MTestable (Test.Microspec.TestTree Test.QuickCheck.Property.Property)
instance GHC.Internal.Base.Monad Test.Microspec.Microspec
instance GHC.Internal.Read.Read Test.Microspec.MArgs
instance GHC.Internal.Show.Show Test.Microspec.MArgs
instance GHC.Internal.Show.Show Test.Microspec.ResultCounts
instance GHC.Internal.Show.Show (Test.Microspec.TestTree x)
