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
{{ message }}
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.
We would like to support multiline syntax for properties in doctest-extract, though, which is currently blocked by missing support in Haddock. We have factored out the doctest parser to https://hackage.haskell.org/package/doctest-lib, thus haddock and doctest-extract and doctest could use the same parser.
As an end user, I still would like this feature to be implemented. Currently, multi-line doctest unit tests are actually not supported by Haddock; it just works by coincidence.
For the following doc comment:
-- >>> :{-- some-- test-- lines-- :}
Haddock renders the first line (i.e., :{) as code (with a bold font), but the rest of lines as output text (with a normal font). Ideally, the code block should instead be written as follows:
so as to indicate all these lines are test code instead of output texts, but Haddock would trim the leading whitespace, resulting in incorrect layout.
Anyway, I believe this issue is still relevant for Haddock and should be migrated to the GHC repo on GitLab. One of the few things I miss after returning to Haskell from Rust is the integration of doctests, and I sincerely hope this situation could improve over time.
Doctest supports multiline syntax
:{ .. :}
for doctest unit tests, e.g.but it does not support that syntax for doctest properties, that is
We would like to support multiline syntax for properties in
doctest-extract
, though, which is currently blocked by missing support in Haddock. We have factored out the doctest parser to https://hackage.haskell.org/package/doctest-lib, thus haddock and doctest-extract and doctest could use the same parser.See also: sol/doctest#131
The text was updated successfully, but these errors were encountered: