Repository navigation
Make str() snapshots stable across R versions - #271
Merged
Merged
Conversation
R-devel (r90805) always puts one space after `$ name:`, `@ slot:` and `attr(*, "x")=` in str() output, which older R sometimes omitted (e.g., `$ n :'data.frame'`), breaking the `expect_snapshot(tbl)` snapshots on R-devel. Add a `print_str()` test helper that normalizes that separator and use it for the three affected snapshots. Co-Authored-By: Claude Code <noreply@anthropic.com>
LittleBeannie
approved these changes
Nov 5, 2026
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.
Fixes the R-devel failure in https://github.com/Merck/metalite.ae/actions/runs/41533856815 (PR #269): R-devel (wch/r-source@83231b3) now always puts one space after
$ name:,@ slot:andattr(*, "x")=instr()output, which older R sometimes omitted ($ n :'data.frame'vs$ n : 'data.frame'). Threeexpect_snapshot(tbl)snapshots depend on that output.print_str()test helper (tests/testthat/helper.R) that normalizes that separator to exactly one space.expect_snapshot(print_str(tbl))in the three affected tests and update their snapshots (only the spacing and the snapshot code line change).Tests only; no change to package code, so no NEWS entry. The full testthat suite passes locally on R 4.6.1; R-devel is verified by the CI devel job.
🤖 Generated with Claude Code