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 test harness #49

Merged
merged 7 commits into from
Feb 23, 2022
Merged

Add test harness #49

merged 7 commits into from
Feb 23, 2022

Conversation

dhardy
Copy link
Member

@dhardy dhardy commented Feb 22, 2022

Uses doc_comment to add a test harness for the code samples within documentation. This allows us to specify dependency versions (not possible through mdbook).

Note that not all code samples actually run since this uses the playground, which currently uses an old version of rand_pcg.

As for testing links... in theory mdbook-linkcheck does this, but using it on this repo generates a lot of errors like this:

error: Linking outside of the "root" directory is forbidden
    ┌─ update-0.8.md:190:1
    │
190 │ [`IteratorRandom::choose_stable`] was added to provide an alternative that
    │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Linking outside of the "root" directory is forbidden

These links (e.g. ../rand/rand/seq/trait.IteratorRandom.html#method.choose_stable) work where deployed (and locally with a symlink to the built docs). We could replace with absolute URLs, but I suspect linkcheck would ignore them in that case.

... thus, I just laboriously clicked on every link to test.

Some documentation got updated here: the Sequences page, part of the Distributions page. @vks would be nice if you do a quick review.

Closes #46. Closes #2 (well, link checks are omitted — without a plan for handling cross-crate links I don't see much use for it).

src/guide-dist.md Outdated Show resolved Hide resolved
src/guide-err.md Outdated Show resolved Hide resolved
src/guide-seq.md Outdated Show resolved Hide resolved
Copy link
Contributor

@vks vks left a comment

Choose a reason for hiding this comment

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

Looks great! I only have some minor questions and suggestions.

dhardy and others added 2 commits February 23, 2022 10:35
Co-authored-by: Vinzent Steinberg <Vinzent.Steinberg@gmail.com>
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.

Broken links due to rand_distr split Test code examples and links
2 participants