Skip to content

Commit

Permalink
refactor assign_round_number
Browse files Browse the repository at this point in the history
  • Loading branch information
truenomad committed Feb 6, 2025
1 parent 3cdd61f commit 576490a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/testthat/test-assign_round_number.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ testthat::test_that("assign_round_number works with basic functionality", {

result <- assign_round_number(df, date_col = "today", threshold = 7)

expected_groups <- c("April 2024", "April 2024", "April 2024", "June 2024")
expected_groups <- c("Apr 2024", "Apr 2024", "Apr 2024", "Jun 2024")

testthat::expect_equal(levels(result$round_group),
c("April 2024", "May 2024","June 2024"))
c("Apr 2024", "May 2024","Jun 2024"))
})


Expand All @@ -23,11 +23,11 @@ testthat::test_that("assign_round_number works with basic functionality", {
result <- assign_round_number(df, date_col = "today", threshold = 7,
additional_grouping = "states")

expected_groups <- c("April 2024", "April 2024", "April 2024",
"June 2024", "April 2024", "April 2024", "April 2024")
expected_groups <- c("Apr 2024", "Apr 2024", "Apr 2024",
"Jun 2024", "Apr 2024", "Apr 2024", "Apr 2024")

testthat::expect_equal(levels(result$round_group),
c("April 2024", "May 2024","June 2024"))
c("Apr 2024", "May 2024","Jun 2024"))
})


0 comments on commit 576490a

Please sign in to comment.