Skip to content

tests: add edge-case tests for uncount()#1643

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

tests: add edge-case tests for uncount()#1643
LeonidasZhak wants to merge 1 commit into
tidyverse:mainfrom
LeonidasZhak:tests/uncount-edge-cases

Conversation

@LeonidasZhak

Copy link
Copy Markdown

Adds 7 edge-case test blocks for uncount() covering:

  • Factor column preservation
  • Date column preservation
  • POSIXct column preservation
  • .id counter resetting per group
  • All zero weights producing empty data frame
  • NA weights producing informative error
  • List column preservation

All 24 tests pass (10 existing + 14 new). No regressions introduced.

Note: PR #1619 addresses the .data pronoun bug in uncount() — this PR focuses purely on test coverage for data cleaning edge cases.

Add 7 test blocks covering:
- Factor column preservation
- Date column preservation
- POSIXct column preservation
- .id counter resetting per group
- All zero weights producing empty data frame
- NA weights producing informative error
- List column preservation
})

test_that("preserves POSIXct columns", {
times <- as.POSIXct(c("2024-01-01 10:00:00", "2024-06-15 14:30:00"), tz = "UTC")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[air] reported by reviewdog 🐶

Suggested change
times <- as.POSIXct(c("2024-01-01 10:00:00", "2024-06-15 14:30:00"), tz = "UTC")
times <- as.POSIXct(
c("2024-01-01 10:00:00", "2024-06-15 14:30:00"),
tz = "UTC"
)

@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