Repository navigation
Handle str() spacing across R versions - #793
Merged
Merged
Conversation
Replace shared output buffering with version-aware separators, retaining the fixes for ordinary lists, data frames, environments, and inherited logical data. Keep one compact regression test and the existing nested-list snapshot variants; remove capture-specific tests and the benchmark script.
Restore the nested-list snapshot to class.md, normalizing only base R's version-dependent separator. Replace exact-string assertions with a snapshot that also checks the complete nested output.
Fold logical-value coverage into the existing display snapshot and handle classed environment properties while preserving S7 environments' own legacy separator.
hadley
approved these changes
Nov 3, 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.
Restore separators in S7's
str()andprint()output after R 4.7 changed which call supplies the leading space. Property values retain their separator, and S7 objects nested in lists avoid doubled spaces. Also fix missing spaces before plain lists, data frames, and classed environments, and extra spaces before inherited data such as logical values and empty lists on older R.Use a shared helper to print property values and inherited data directly, with an R-version flag cached in
.onLoad(). Extend the existing snapshots for logical values and environment properties, and retain the nested-list fixture while normalizing its base-R spacing difference.Fixes #791.
Alternative to #792.