Skip to content

test: add edge-case tests for fct_shuffle()#400

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

test: add edge-case tests for fct_shuffle()#400
LeonidasZhak wants to merge 1 commit into
tidyverse:mainfrom
LeonidasZhak:tests/fct-shuffle-edge-cases

Conversation

@LeonidasZhak

Copy link
Copy Markdown

Add edge-case tests for fct_shuffle() covering common data cleaning scenarios. Currently fct_shuffle() has only 1 test (basic reproducibility check).

Tests added

  1. NA values preserved: Verifies NA positions are maintained after level shuffling
  2. Empty factor: Verifies empty input returns empty factor with levels intact
  3. Single level factor: Verifies single-level factor is unchanged
  4. Unused levels preserved: Verifies unused levels remain after shuffling
  5. Ordered class preserved: Verifies ordered factor class is maintained

Validation

  • New tests: [ FAIL 0 | WARN 0 | SKIP 0 | PASS 10 ]
  • Full test suite: [ FAIL 1 | WARN 0 | SKIP 0 | PASS 228 ] (1 pre-existing snapshot mismatch in test-collapse.R due to lifecycle wording change, unrelated)
  • Consistent with edge-case test pattern used for fct_rev() (PR test: add edge-case tests for fct_rev() #399)

Add tests for NA handling, empty factors, single-level factors,
unused levels, and ordered factor class preservation.
@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