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

Add doctest #354

Merged
merged 7 commits into from
Dec 16, 2023
Merged

Add doctest #354

merged 7 commits into from
Dec 16, 2023

Conversation

ocramz
Copy link
Collaborator

@ocramz ocramz commented Dec 1, 2023

closes #353

@ocramz ocramz changed the title WIP example docstrings using curl should be ported to use hspec-wai WIP add doctest Dec 1, 2023
@ocramz
Copy link
Collaborator Author

ocramz commented Dec 1, 2023

WIP example docstrings using curl should be ported to use hspec-wai

@ocramz ocramz marked this pull request as ready for review December 3, 2023 08:06
@ocramz ocramz requested a review from fumieval December 3, 2023 08:06
@ocramz
Copy link
Collaborator Author

ocramz commented Dec 3, 2023

I've ported a few docstrings to doctest, now we can be sure the examples stay in sync with the code :)

There's a bit of code duplication but doctest doesn't seem to follow module imports and I'd rather not import 'http-client' into the main scotty library.

@ocramz ocramz changed the title WIP add doctest Add doctest Dec 3, 2023
@ocramz
Copy link
Collaborator Author

ocramz commented Dec 4, 2023 via email

@fumieval
Copy link
Collaborator

fumieval commented Dec 6, 2023

Hmm I'm not quite sure what is going on :/

@ocramz
Copy link
Collaborator Author

ocramz commented Dec 16, 2023

@fumieval ahh figured this out! it's a GHCi bug, unrelated to doctest. GHCi only recently started supporting multiline imports : https://github.com/scotty-web/scotty/actions/runs/7075697407/job/19258105080?pr=354#step:7:95, related GHC ticket: https://gitlab.haskell.org/ghc/ghc/-/issues/20473

@ocramz
Copy link
Collaborator Author

ocramz commented Dec 16, 2023

@fumieval I've turned doctest into a pure () for GHCs older than 9.4.6 , wdyt? de8d739

@ocramz ocramz merged commit e6a9735 into scotty-web:master Dec 16, 2023
6 checks passed
@ocramz
Copy link
Collaborator Author

ocramz commented Dec 16, 2023

I'll merge this for now, we can revisit later if needed.

@ocramz ocramz deleted the add-doctest-#353 branch December 16, 2023 12:10
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

Successfully merging this pull request may close these issues.

Add doctest
2 participants