Skip to content

test: add edge-case tests for fct_collapse() and fct_lump_lowfreq()#401

Closed
LeonidasZhak wants to merge 1 commit into
tidyverse:mainfrom
LeonidasZhak:tests/collapse-lump-edge-cases
Closed

test: add edge-case tests for fct_collapse() and fct_lump_lowfreq()#401
LeonidasZhak wants to merge 1 commit into
tidyverse:mainfrom
LeonidasZhak:tests/collapse-lump-edge-cases

Conversation

@LeonidasZhak

Copy link
Copy Markdown

Summary

Adds edge-case tests for two data-cleaning functions: fct_collapse() and fct_lump_lowfreq().

fct_collapse() tests

  • NA values preserved when collapsing: Verifies NA observations remain NA after collapsing levels
  • Unused levels collapsed correctly: Verifies unused factor levels are properly renamed when collapsed
  • !!! splice works: Verifies dynamic dots / named list input via !!!

fct_lump_lowfreq() tests

  • Unused levels: Verifies behavior when input factor has unused levels
  • NA values preserved: Verifies NA observations remain NA after lumping

Snapshot fix

  • Updated lifecycle deprecation wording in _snaps/collapse.md from "is deprecated as of" to "was deprecated in" to match current lifecycle package.

Validation

devtools::test()
# [ FAIL 0 | WARN 0 | SKIP 0 | PASS 233 ]

All 233 tests pass (14 new tests added).

- fct_collapse: test NA values preserved, unused levels collapsed, !!! splice
- fct_lump_lowfreq: test unused levels, NA values preserved
- Fix lifecycle snapshot wording for group_other deprecation
@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