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

-- | Write tests in Lua, integrate into tasty.
--   
--   Allow users to define tasty tests from Lua.
@package tasty-lua
@version 0.2.2

-- | Tasty Lua module, providing the functions necessary to write tasty
--   tests in Lua scripts.
module Test.Tasty.Lua.Module

-- | Push the Aeson module on the Lua stack.
pushModule :: Lua NumResults

-- | Core types and functions for tasty Lua tests.
module Test.Tasty.Lua.Core

-- | Run a tasty Lua script from a file and return either the resulting
--   test tree or the error message.
runTastyFile :: FilePath -> Lua (Either String [ResultTree])

-- | Tree of test results returned by tasty Lua scripts. This is similar to
--   tasty's TestTree, with the important difference that
--   all tests have already been run, and all test results are known.
data ResultTree
ResultTree :: TestName -> UnnamedTree -> ResultTree

-- | Test outcome
data Outcome
Success :: Outcome
Failure :: String -> Outcome

-- | Either a raw test outcome, or a nested Tree.
data UnnamedTree
SingleTest :: Outcome -> UnnamedTree
TestGroup :: [ResultTree] -> UnnamedTree
instance Foreign.Lua.Types.Peekable.Peekable Test.Tasty.Lua.Core.ResultTree
instance Foreign.Lua.Types.Peekable.Peekable Test.Tasty.Lua.Core.UnnamedTree
instance Foreign.Lua.Types.Peekable.Peekable Test.Tasty.Lua.Core.Outcome

-- | Translate test results from Lua into a Tasty
--   TestTree.
module Test.Tasty.Lua.Translate

-- | Run tasty.lua tests from the given file and translate the result into
--   a mock Tasty TestTree.
translateResultsFromFile :: FilePath -> Lua TestTree

-- | Report failure of testing a path.
pathFailure :: FilePath -> String -> TestTree
instance Test.Tasty.Core.IsTest Test.Tasty.Lua.Translate.MockTest

-- | Convert Lua test results into a tasty test trees.
module Test.Tasty.Lua

-- | Push the Aeson module on the Lua stack.
pushModule :: Lua NumResults

-- | Run the given file as a single test. It is possible to use `tasty.lua`
--   in the script. This test collects and summarizes all errors, but shows
--   generally no information on the successful tests.
testLuaFile :: (forall a. Lua a -> IO a) -> TestName -> FilePath -> TestTree

-- | Run tasty.lua tests from the given file and translate the result into
--   a mock Tasty TestTree.
translateResultsFromFile :: FilePath -> Lua TestTree

-- | Report failure of testing a path.
pathFailure :: FilePath -> String -> TestTree
instance Test.Tasty.Core.IsTest Test.Tasty.Lua.TestCase
instance GHC.Base.Semigroup Test.Tasty.Lua.ResultSummary
instance GHC.Base.Monoid Test.Tasty.Lua.ResultSummary
