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

-- | Mark tasty tests as failure expected
--   
--   With the function Test.Tasty.ExpectedFailure.expectFail in the
--   provided module Test.Tasty.ExpectedFailure, 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 Test.Tasty.ExpectedFailure.expectFail,
--   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
--   Test.Tasty.ExpectedFailure.expectFail marker.
--   
--   The module also provides Test.Tasty.ExpectedFailure.ignoreTest
--   to avoid running a test. Both funtions are implemented via the more
--   general Test.Tasty.ExpectedFailure.wrapTest, which is also
--   provided.
@package tasty-expected-failure
@version 0.12.3

module Test.Tasty.ExpectedFailure

-- | Marks all tests in the given test suite 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 expectFail marker.
expectFail :: TestTree -> TestTree

-- | Like expectFail 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 withResource
--   are still executed. You can bypass this manually as in the following
--   example:
--   
--   
--   askOption $ \(MyFlag b) -> if b
--                              then withResource mytest
--                              else ignoreTest . mytest $ return junkvalue
--   
ignoreTest :: TestTree -> TestTree

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

-- | wrapTest 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 expectFail and ignoreTest.
wrapTest :: (IO Result -> IO Result) -> TestTree -> TestTree
instance Test.Tasty.Core.IsTest t => Test.Tasty.Core.IsTest (Test.Tasty.ExpectedFailure.WrappedTest t)
