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

Migrate tests from doctests to #[test]s #718

Open
Tracked by #533
nightkr opened this issue Jan 15, 2024 · 3 comments
Open
Tracked by #533

Migrate tests from doctests to #[test]s #718

nightkr opened this issue Jan 15, 2024 · 3 comments

Comments

@nightkr
Copy link
Member

nightkr commented Jan 15, 2024

Doctests require a separate compilation per test, which is slow and uses immense amounts of RAM if allowed to run in parallel.

@NickLarsenNZ
Copy link
Member

Could you please provide an example of moving a doctest to a #[test]?

@NickLarsenNZ
Copy link
Member

Ah, I see. There are some ignored doc-tests.

I quite like the doctests. Or rather that knowing that an example is correct as the code changes.
An alternative could be to move things out to examples.

@NickLarsenNZ
Copy link
Member

I think we might not need this anymore with Rust 2024 on the horizon, which compiles doc-tests into a single binary: https://doc.rust-lang.org/edition-guide/rust-2024/rustdoc-doctests.html

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

2 participants