Popularity
5.6
Declining
Activity
2.4
-
5
6
1
Monthly Downloads: 3
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags:
Testing
Latest version: v1.1.0
th-test-utils alternatives and similar packages
Based on the "Testing" category.
Alternatively, view th-test-utils alternatives based on common mentions on social networks and blogs.
-
curl-runnings
A declarative test framework for quickly and easily writing integration tests against JSON APIs. -
monad-mock
DISCONTINUED. A Haskell package that provides a monad transformer for mocking mtl-style typeclasses [GET https://api.github.com/repos/cjdev/monad-mock: 404 - Not Found // See: https://docs.github.com/rest/repos/repos#get-a-repository] -
quickcheck-arbitrary-adt
Typeclass for generating a list of each instance of a sum type's constructors -
test-fixture
DISCONTINUED. Testing with monadic side-effects [GET https://api.github.com/repos/cjdev/test-fixture: 404 - Not Found // See: https://docs.github.com/rest/repos/repos#get-a-repository] -
test-framework-th
Automagically (using Template Haskell) generates the Haskell-code you need when using HUnit -
tasty-ant-xml
A tasty ingredient to output test results in XML, using the Ant schema. This XML can be consumed by the Jenkins continuous integration framework.
InfluxDB โ Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
Promo
www.influxdata.com

Do you think we are missing an alternative of th-test-utils or a related project?
README
th-test-utils
This package implements tryTestQ
and related helpers in order to better test Template Haskell code. It supports returning the actual error message that recover
doesn't currently return as well as mocking out Q
actions, so that you can run Template Haskell code at runtime.
Usage
-- e.g. $(showInfo "Bool") generates a string corresponding
-- to the reify `Info` for `Bool`.
showInfo :: String -> Q Exp
showInfo s = do
mName <- lookupTypeName s
case mName of
Nothing -> fail $ "Unknown type: " ++ s
Just name -> do
info <- reify name
lift $ show info
-- example using tasty-hunit
main :: IO ()
main = defaultMain $ testGroup "my-project"
[ testCase "showInfo unmocked" $(do
result1 <- tryTestQ unmockedState $ showInfo "Bool"
runIO $ isRight result1 @? ("Unexpected error: " ++ show result1)
result2 <- tryTestQ unmockedState $ showInfo "Foo"
runIO $ result2 @?= Left "Unknown type: Foo"
[| return () |]
)
, testCase "showInfo mocked success" $ do
let state = QState
{ mode = MockQ
, knownNames = [("Bool", ''Bool)]
, reifyInfo = $(loadNames [''Bool])
}
let result1 = tryTestQ state $ showInfo "Bool"
isRight result1 @? ("Unexpected error: " ++ show result1)
let result2 = tryTestQ state $ showInfo "Foo"
result2 @?= Left "Unknown type: Foo"
]