Skip to content
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

Embedded doctests #55

Open
LeventErkok opened this issue Dec 27, 2018 · 0 comments
Open

Embedded doctests #55

LeventErkok opened this issue Dec 27, 2018 · 0 comments

Comments

@LeventErkok
Copy link

LeventErkok commented Dec 27, 2018

I've been looking for a document writing system and madoko seems pretty cool. I looked through the docs, but couldn't find any specific mention for embedded tests though. Is it possible to mark code blocks for testing, as in doctest? I'm imagining something like:

```haskell
foo :: Int -> Int
foo x = x + 1
``` 

And then:

```haskell {test}
foo 3 == 4
```

The above wouldn't be rendered in the final document. And more importantly:

```haskell {doctest}
>>> foo 3
4
```

which would render the test case in the document also check that it is still true, in the style of doctest: http://hackage.haskell.org/package/doctest

Of course, the devil is in the details. Have you given this any thought or have any advice on how to go about such a system?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant