bennofs / tasty-th Goto Github PK
View Code? Open in Web Editor NEWThis project forked from finnsson/test-generator
Automatically generate tasty test groups from functions in a module using TH
This project forked from finnsson/test-generator
Automatically generate tasty test groups from functions in a module using TH
We should have a test for cases where we need haskell-src-exts for parsing correctly (for example, literate haskell)
Example.hs:90:9: error: [-Wdeprecations, -Werror=deprecations]
In the use of ‘testProperty’ (imported from Test.Tasty.Hedgehog):
Deprecated: "testProperty will cause Hedgehog to provide incorrect instructions for re-checking properties"
|
90 | tests = $testGroupGenerator
| ^^^^^^^^^^^^^^^^^^^
It looks like Hackage does not detect our README in the package description. We should fix that.
I have 2 test suites, both of them use testGroupGenerator
. One of them executes tests, the other does not. Have a look at my cabal package:
https://github.com/sgillespie/elocrypt/blob/6ea4f0c1ab3550e069427c804527c0fb0fbd0f40/elocrypt.cabal
You can see the output of the test here:
https://travis-ci.org/sgillespie/elocrypt/builds/220181604#L210
You can see that it's not executing any tests for the second suite (ui-tests). However, if I downgrade to version 0.1.4, it executes both suites.
If a line in a comment begins with prop_
then defaultMainGenerator
will generate invalid code.
Here's a repo demonstrating this https://github.com/expipiplus1/tasty-bug
{-# LANGUAGE TemplateHaskell #-}
import Test.Tasty.TH
{-
prop_foo
-}
main = $(defaultMainGenerator)
testGroupGenerator
does not find any tests in an lhs file.
{-# LANGUAGE TemplateHaskell #-}
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.TH (testGroupGenerator)
test_foo = [ testCase "t1" $ 2 @?= 2
]
main :: IO ()
main = defaultMain $(testGroupGenerator)
› runhaskell test.hs <146>
Main
foo
t1: OK
All 1 tests passed (0.00s)
> {-# LANGUAGE TemplateHaskell #-}
>
> import Test.Tasty
> import Test.Tasty.HUnit
> import Test.Tasty.TH (testGroupGenerator)
>
>
> test_foo = [ testCase "t1" $ 2 @?= 2
> ]
>
> main :: IO ()
> main = defaultMain $(testGroupGenerator)
› runhaskell test.lhs
All 0 tests passed (0.00s)
In the following snippet:
module Main where
import Test.Tasty
import Test.Tasty.TH
import Test.Tasty.Quickcheck
import AllMyPropTests
main :: IO ()
main = $(defaultMainGenerator)
If I have all my quickcheck properties defined (as prop_*
) in test/AllMyPropTests
, should the properties be picked up and run?
It isn't working for me so far, but I have a strange use case. I am trying to create a new Tasty plugin which does test discovery, and I think the API would be greatly improved by using tasty-th
. The implementation is 'borrowed' from the awesome hspec and their discover implementation.
The Tasty plugins pre processed output will be the following code which will auto import all test modules under the users test directory. Then, the main generator would generate the boilerplate to run the tests.
I'd really like to get this working. Is there some TemplateHaskell limitation here? Any help really appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.