Skip to content

test: expand zap_widths() test coverage#809

Closed
LeonidasZhak wants to merge 1 commit into
tidyverse:mainfrom
LeonidasZhak:test/zap-widths-coverage
Closed

test: expand zap_widths() test coverage#809
LeonidasZhak wants to merge 1 commit into
tidyverse:mainfrom
LeonidasZhak:test/zap-widths-coverage

Conversation

@LeonidasZhak

Copy link
Copy Markdown

Summary

This PR expands test coverage for zap_widths(), which removes the display_width attribute from vectors. The function had only 2 tests covering basic cases. This PR adds 5 new tests covering edge cases and attribute preservation, bringing the total to 7 tests.

Tests added

  • Labelled vectors: verifies class and labels attribute are preserved
  • labelled_spss vectors: verifies na_values attribute is preserved
  • Attribute preservation: verifies format.spss and label attributes remain after zapping widths
  • Multi-column data frames: verifies widths are removed from all columns
  • NA preservation: verifies existing NAs are not affected

Validation

  • devtools::test(filter = "zap-widths") — all 7 tests pass
  • Full test suite passes (pre-existing Unicode snapshot failure in test-labelled-pillar.R, unrelated)

- Add test for labelled vectors (verifies class and labels preserved)
- Add test for labelled_spss vectors (verifies na_values preserved)
- Add test that other attributes (format.spss, label) are preserved
- Add test for data frames with multiple columns
- Add test that existing NAs are preserved
- Total: 7 tests (was 2)
@LeonidasZhak

Copy link
Copy Markdown
Author

Withdrawing this small automated PR while I consolidate an oversized batch of contributions and reduce maintainer review burden. Sorry for the noise, and thank you for maintaining the project.

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.

1 participant