tasty-lua alternatives and similar packages
Based on the "Foreign" category.
Alternatively, view tasty-lua alternatives based on common mentions on social networks and blogs.
-
erlang
A Foreign Function Interface that lets Haskell and Erlang programs communicate. -
emacs-module
Wrappers around emacs-module.h to write Emacs modules in Haskell -
greencard
Green Card, a foreign function interface pre-processor for Haskell. -
c-storable-deriving
Derivation of C-like Storable Instances -
hslua-module-text
Lua module providing a selected set of operations on Text. NOTE: moved into the hslua monorepo. -
hslua-module-system
HsLua module for system and directory functions. This repository has been moved to the hslua monorepo. -
hslua-module-doclayout
Lua module wrapping Text.DocLayout. -
marshal-contt
A ContT-based wrapper for Haskell-to-C marshalling functions. -
foreign-storable-asymmetric
Types and instances for implementing a Storable with different peek and poke
Static code analysis for 29 languages.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of tasty-lua or a related project?
Popular Comparisons
README
Tasty Lua
Write tests in Lua, integrate into tasty.
This package is not a traditional tasty test provider in that
tests are not run in Haskell. Instead, this package allows to
write and run tests in Lua; the results are then converted into
a format that allows to process the test results with Tasty. A
basic Lua test-suite is provided with the tasty
Lua module.
Example
Tasty Lua scripts can be put into a separate file and then loaded in the test program. The script must return the test result tree:
-- FILE: example-tests.lua
local tasty = require 'tasty'
local assert = tasty.assert
return {
tasty.group 'examples {
tasty.test('multiplication', function() assert.are_equal(6, 2 * 3) end),
tasty.test('truthyness', function() assert.is_truthy(0) end),
tasty.group 'nil' {
tasty.test('0 is nil', function () assert.is_nil(0) end)
}
}
}
On the Haskell side, the script is executed and the results are included in the test results. Two ways of integrating the tests into the test output are supported.
One test per file
This method is closest to the Tasty's intended way of running tests. A script is run as a single test case. On success, the number of passing Lua tests is included in the output. In the case of a failure, all failure information is collected and presented to the user.
import Test.Tasty (defaultMain, testGroup)
import Test.Tasty.Lua (testLuaFile)
import Foreign.Lua (run)
main = defaultMain $
testLuaFile run "Lua example tests" "example-tests.lua"
Lua tests as Tasty tests
Lua tests can be transformed into mock Tasty tests, thus showing all tests with their status in the final output.
import Foreign.Lua (run)
import System.Directory (withCurrentDirectory)
import Test.Tasty (defaultMain, testGroup)
import Test.Tasty.Lua (translateResultsFromFile)
main = do
luaTest <- withCurrentDirectory "test" . run $ do
-- run other commands to setup the Lua environment here.
translateResultsFromFile "example-tests.lua"
defaultMain . testGroup "Haskell and Lua tests" $
[ luaTest
-- more tasty tests go here
]