-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test-framework-th does not respect comments #3
Comments
Darn. Previously test-generator used haskell-src-exts to parse the source code so it probably used to respect comments, but I had problems with haskell-src-exts and extensions that the parser did not support so I switched to just split each line and search for "prop_" och "case_" in the beginning of lines. This had the consequence that the parser cannot identity which lines are inside comments. I guess a solution would be to strip lines between {- and -}. I'll take a look at the problem during the weekend. |
The same issue also applies to *.lhs files: > module Broken where
>
> import Test.Framework.TH
> import Test.Framework
> import Test.HUnit
> import Test.Framework.Providers.HUnit
case_nonexistent is not a Haskell function, but just text.
> case_ignored = do 1 @=? 1
>
> main = $(defaultMainGenerator) The
This means that test-framework-th is not yet usable with literate Haskell files. |
This issue is caused by language-haskell-extract that simply reads first lexemas on every line to extract functions.
Pull request 10 in template-helper should fix the issue with comments and the above examples: finnsson/template-helper#10 |
This works:
But the following does not:
The text was updated successfully, but these errors were encountered: