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


-- | Generators for arbitrary Lua values.
module Test.Tasty.Lua.Arbitrary

-- | Register a Lua value generator.
registerArbitrary :: forall a e. (Arbitrary a, LuaError e) => Name -> Pusher e a -> Peeker e a -> LuaE e ()
registerDefaultGenerators :: LuaError e => LuaE e ()

-- | Pushes the table holding all arbitrary generators to the stack.
pushArbitraryTable :: LuaE e ()


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

-- | Push the tasty module on the Lua stack.
pushModule :: LuaError e => HaskellFunction e


-- | 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 :: LuaError e => FilePath -> LuaE e (Either String [ResultTree])

-- | Tree of test results returned by tasty Lua scripts. This is similar to
--   tasty's <tt><tt>TestTree</tt></tt>, 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 <tt><tt>Tree</tt></tt>.
data UnnamedTree
SingleTest :: Outcome -> UnnamedTree
TestGroup :: [ResultTree] -> UnnamedTree


-- | Translate test results from Lua into a Tasty
--   <tt><tt>TestTree</tt></tt>.
module Test.Tasty.Lua.Translate

-- | Run tasty.lua tests from the given file and translate the result into
--   a mock Tasty <tt><tt>TestTree</tt></tt>.
translateResultsFromFile :: LuaError e => FilePath -> LuaE e 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 tasty module on the Lua stack.
pushModule :: LuaError e => HaskellFunction e

-- | 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 e. LuaError e => (forall a. LuaE e a -> IO a) -> TestName -> FilePath -> TestTree

-- | Run tasty.lua tests from the given file and translate the result into
--   a mock Tasty <tt><tt>TestTree</tt></tt>.
translateResultsFromFile :: LuaError e => FilePath -> LuaE e TestTree

-- | Report failure of testing a path.
pathFailure :: FilePath -> String -> TestTree

-- | Register a Lua value generator.
registerArbitrary :: forall a e. (Arbitrary a, LuaError e) => Name -> Pusher e a -> Peeker e a -> LuaE e ()
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
