tasty-lua-1.1.0: Write tests in Lua, integrate into tasty.

Copyright | © 2019-2023 Albert Krewinkel
License | MIT
Maintainer | Albert Krewinkel <tarleb@hslua.org>
Stability | alpha
Portability | Requires TemplateHaskell
Safe Haskell | Safe-Inferred
Language | Haskell2010

Test.Tasty.Lua

Contents

- Lua module
- Running tests
- Helpers

Description

Convert Lua test results into a tasty test trees.

Synopsis

- pushModule :: LuaError e => HaskellFunction e
- testLuaFile :: forall e. LuaError e => (forall a. LuaE e a -> IO a) -> TestName -> FilePath -> TestTree
- translateResultsFromFile :: LuaError e => FilePath -> LuaE e TestTree
- pathFailure :: FilePath -> String -> TestTree
- registerArbitrary :: forall a e. (Arbitrary a, LuaError e) => Name -> Pusher e a -> Peeker e a -> LuaE e ()

# Lua module

pushModule :: LuaError e => HaskellFunction e Source #

Push the tasty module on the Lua stack.

# Running tests

testLuaFile :: forall e. LuaError e => (forall a. LuaE e a -> IO a) -> TestName -> FilePath -> TestTree Source #

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.

translateResultsFromFile :: LuaError e => FilePath -> LuaE e TestTree Source #

Run tasty.lua tests from the given file and translate the result into a mock Tasty ``TestTree``.

# Helpers

pathFailure :: FilePath -> String -> TestTree Source #

Report failure of testing a path.

registerArbitrary :: forall a e. (Arbitrary a, LuaError e) => Name -> Pusher e a -> Peeker e a -> LuaE e () Source #

Register a Lua value generator.