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

Stdlib: use assertEqual in all doc strings #7374

Open
cknitt opened this issue Apr 1, 2025 · 0 comments
Open

Stdlib: use assertEqual in all doc strings #7374

cknitt opened this issue Apr 1, 2025 · 0 comments
Assignees
Milestone

Comments

@cknitt
Copy link
Member

cknitt commented Apr 1, 2025

As the examples from the doc strings are now tested during CI build (or via node scripts/test.js -docstrings), we are using assertEqual in the examples to verify the results of the various stdlib function calls, e.g.,

Array.make(~length=3, #apple)->assertEqual([#apple, #apple, #apple])

However, we are not doing this consistently in all modules. E.g., it is missing in the List and Math modules.

Remark: IMHO, for documentation purposes, the assertEqual in the examples doesn't actually look that nice. But we require it for testing. Any ideas how to improve this are welcome.

@cknitt cknitt added this to the v12 milestone Apr 1, 2025
@cknitt cknitt moved this to Ready in ReScript development Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready
Development

No branches or pull requests

2 participants