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 docstrings compiler tests #7184

Draft
wants to merge 54 commits into
base: master
Choose a base branch
from

Conversation

aspeddro
Copy link
Contributor

@aspeddro aspeddro commented Dec 1, 2024

Add tests for docstrings examples

From rescript-lang/rescript-core#184

We can extend this PR to add runtime tests (rescript-lang/rescript-core#210)

@aspeddro aspeddro changed the title add docstrings tests add docstrings compiler tests Dec 2, 2024
@aspeddro aspeddro marked this pull request as draft December 5, 2024 04:05
Copy link
Member

@cknitt cknitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, thanks a lot @aspeddro, I had completely overlooked this PR!

Regarding adding assert_eq to Pervasives, I think we should use follow ReScript naming conventions rather than OCaml naming conventions, i.e., use assertEqual rather than assert_eq.

I am also wondering if all those assertions look nice enough in the doc comments / hover help in VS Code, or whether we could maybe separate them somehow so that they are executed in the tests, but not shown in hover help.
Any thoughts on that @zth?

tests/docstrings_examples/DocTest.res Outdated Show resolved Hide resolved
let runtimeErrors =
(await compiled
->Array.filter((({id}, _, _)) => !Array.includes(ignoreRuntimeTests, id))
->Array.map(async ((example, rescriptCode, jsCode)) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is too much parallelism here, you might consider a solution like in #7081.

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.

2 participants