fix(docs): drop testthat from the whereInStack example (last red leg on #44) - #49
Merged
Merged
Conversation
The last line of the whereInStack example called
testthat::expect_error(findB3())
testthat is in Suggests, so under `_R_CHECK_DEPENDS_ONLY_` it is not on the
library path and R CMD check fails outright:
* checking examples ... ERROR
Error in loadNamespace(x) : there is no package called 'testthat'
* checking examples with --run-donttest ... ERROR
`try()` is a better fit regardless. The point of that line is to show the
reader that dynGet("b$a") fails because `b$a` is not an object name, and try()
prints the error where expect_error() swallowed it -- so the example now
demonstrates the thing it is describing, to every reader, whether or not they
have testthat installed. Verified it still errors identically:
Error in dynGet("b$a") : 'b$a' not found
Found by the nosuggests leg of PR #44's matrix, which is the first
`_R_CHECK_DEPENDS_ONLY_` check this package has ever had. Its tests now pass
there (FAIL 0 | SKIP 12 | PASS 82, the 9 image tests skipped by #46's guard);
this was the only remaining failure on that leg, and the last red square in an
otherwise green 11-leg matrix.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011kpoQV6nNqcknk16R3RzBB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
whereInStackexample ended with:testthatis in Suggests, so under_R_CHECK_DEPENDS_ONLY_it is not on the library path andR CMD checkfails outright:Replaced with
try(findB3()), inR/plotting.Rand the correspondingman/whereInStack.Rd(hand-edited to match, rather than re-running roxygen and churning every other.Rd).try()is the better call regardless. The point of that line is to show the reader thatdynGet("b$a")fails becauseb$ais not an object name — andtry()prints the error whereexpect_error()swallowed it. The example now demonstrates the thing it describes, for every reader, testthat installed or not. Verified it errors identically:How this surfaced
#44's
nosuggestsleg is the first_R_CHECK_DEPENDS_ONLY_check this package has ever run. After #46's guard landed, its tests pass there —FAIL 0 | SKIP 12 | PASS 82, with the 9 image tests skipped as designed. This examples ERROR was the only thing left, and the only red square in an otherwise green 11-leg matrix on run 33928053320:oldrel-3passing is also new information: it is the first verification of theR (>= 4.3)floor that DESCRIPTION has been asserting.Note
This leg cannot be exercised from a PR into
development— thenosuggestsleg only exists in the shared matrix that #44 introduces. Verification is #44's own re-run once this is onmain(see the companion cherry-pick PR).🤖 Generated with Claude Code
https://claude.ai/code/session_011kpoQV6nNqcknk16R3RzBB