Skip to content

Update test expectations for chk 0.11.0#41

Open
joethorley wants to merge 1 commit into
mainfrom
chk-0-11-0-error-messages
Open

Update test expectations for chk 0.11.0#41
joethorley wants to merge 1 commit into
mainfrom
chk-0-11-0-error-messages

Conversation

@joethorley

Copy link
Copy Markdown
Collaborator

Closes #40

chk 0.11.0 (about to be submitted to CRAN) improves the error messages from chk::chk_s3_class() so they also state the object's actual class, e.g. constants must inherit from S3 class 'nlist', not S3 class 'numeric'. This broke the anchored expectation in the "test inputs" test in tests/testthat/test-simulate.R, which expected the message to end after the class name.

This PR drops the trailing [.]$ anchor from the expected regexp so it matches the message prefix under both versions. Verified locally:

  • CRAN chk 0.10.0: devtools::test(filter = "simulate") gives FAIL 0, PASS 145, SKIP 2 (console-only skips)
  • dev chk 0.11.0: FAIL 0, PASS 145, SKIP 2

So the tests pass with the current CRAN chk as well as with chk 0.11.0 once it reaches CRAN; no need to wait for the chk release to merge.

🤖 Generated with Claude Code

chk 0.11.0 appends the object's actual class to chk_s3_class()
errors (e.g. "must inherit from S3 class 'nlist', not S3 class
'numeric'."). Drop the trailing anchor from the expected regexp
so it matches both chk 0.10.0 and 0.11.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@joethorley
joethorley marked this pull request as ready for review July 15, 2026 12:10
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.

Upcoming chk 0.11.0 release breaks a test expectation in test-simulate.R

1 participant