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


-- | Mark tasty tests as failure expected
--   
--   With the function <a>Test.Tasty.ExpectedFailure.expectFail</a> in the
--   provided module <a>Test.Tasty.ExpectedFailure</a>, you can mark that
--   you expect test cases to fail, and not to pass.
--   
--   This can for example be used for test-driven development: Create the
--   tests, mark them with <a>Test.Tasty.ExpectedFailure.expectFail</a>,
--   and you can still push to the main branch, without your continuous
--   integration branch failing.
--   
--   Once someone implements the feature or fixes the bug (maybe
--   unknowingly), the test suite will tell him so, due to the now
--   unexpectedly passing test, and he can remove the
--   <a>Test.Tasty.ExpectedFailure.expectFail</a> marker.
--   
--   The module also provides <a>Test.Tasty.ExpectedFailure.ignoreTest</a>
--   to avoid running a test. Both funtions are implemented via the more
--   general <a>Test.Tasty.ExpectedFailure.wrapTest</a>, which is also
--   provided.
@package tasty-expected-failure
@version 0.11.1.2

module Test.Tasty.ExpectedFailure

-- | Marks all tests in the give test as expected failures: The tests will
--   still be run, but if they succeed, it is reported as a test suite
--   failure, and conversely a the failure of the test is ignored.
--   
--   Any output of a failing test is still printed.
--   
--   This is useful if, in a test driven development, tests are written and
--   commited to the master branch before their implementation: It allows
--   the tests to fail (as expected) without making the whole test suite
--   fail.
--   
--   Similarly, regressions and bugs can be documented in the test suite
--   this way, until a fix is commited, and if a fix is applied
--   (intentionally or accidentially), the test suite will remind you to
--   remove the <a>expectFail</a> marker.
expectFail :: TestTree -> TestTree

-- | Like <a>expectFail</a> but with additional comment
expectFailBecause :: String -> TestTree -> TestTree

-- | Prevents the tests from running and reports them as succeeding.
--   
--   This may be be desireable as an alternative to commenting out the
--   tests. This way, they are still typechecked (preventing bitrot), and
--   the test report lists them, which serves as a reminder that there are
--   ignored tests.
--   
--   Note that any setup/teardown actions executed by <a>withResource</a>
--   are still executed. You can bypass this manually as in the following
--   example:
--   
--   <pre>
--   askOption $ \(MyFlag b) -&gt; if b
--                              then withResource mytest
--                              else ignoreTest . mytest $ return junkvalue
--   </pre>
ignoreTest :: TestTree -> TestTree

-- | Like <a>ignoreTest</a> but with additional comment
ignoreTestBecause :: String -> TestTree -> TestTree

-- | <a>wrapTest</a> allows you to modify the behaviour of the tests, e.g.
--   by modifying the result or not running the test at all. It is used to
--   implement <a>expectFail</a> and <a>ignoreTest</a>.
wrapTest :: (IO Result -> IO Result) -> TestTree -> TestTree
instance Test.Tasty.Core.IsTest t => Test.Tasty.Core.IsTest (Test.Tasty.ExpectedFailure.WrappedTest t)
