Skip to content

Add test harness - #49

Merged
dhardy merged 7 commits into
masterfrom
work
Feb 23, 2022
Merged

dhardy merged 7 commits into
masterfrom
work

Conversation

@dhardy

@dhardy dhardy commented Feb 22, 2022 •

Copy link
Copy Markdown
Member

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).

Comment thread src/contributing.md Resolved
Comment thread src/guide-dist.md Resolved
Comment thread src/guide-err.md Resolved
Comment thread src/guide-seq.md Resolved

@vks vks left a comment

Copy link
Copy Markdown
Contributor

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.

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