You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, if I comment out the test using {- -}, tasty-discover will still find the test, include it in the tree, but then fail to compile:
{-test_Repro :: TestTreetest_Repro = testCase do ...-}
/home/dc/dev/demo/test/Tree.hs:91:34: error:
Not in scope: ‘Demo.test_Repro’
Module ‘Demo’ does not export ‘test_Repro’.
This seems to stem from the fact that tasty-discover simply reads the entire file and looks for lines starting with one of the supported prefixes (e.g. test_).
Another manifestation of this issue is when a test is wrapped in a CPP-style #if. For example, a test might not work on Windows, so a user might wrap it in #if !defined(mingw32_HOST_OS).
A more robust solution might be to use ghc-lib-parser or ghc-exactprint to parse the file and then extract top-level definitions that start with one of the supported prefixes.
I'd be willing to submit a PR, if the maintainers agree with the change.
The text was updated successfully, but these errors were encountered:
At the moment,
tasty-discover
ignores tests that have been commented out using--
, e.g.:However, if I comment out the test using
{- -}
,tasty-discover
will still find the test, include it in the tree, but then fail to compile:This seems to stem from the fact that
tasty-discover
simply reads the entire file and looks for lines starting with one of the supported prefixes (e.g.test_
).Another manifestation of this issue is when a test is wrapped in a CPP-style
#if
. For example, a test might not work on Windows, so a user might wrap it in#if !defined(mingw32_HOST_OS)
.A more robust solution might be to use
ghc-lib-parser
orghc-exactprint
to parse the file and then extract top-level definitions that start with one of the supported prefixes.I'd be willing to submit a PR, if the maintainers agree with the change.
The text was updated successfully, but these errors were encountered: