Skip to content

Commit

Permalink
Simplify a test
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Jan 2, 2025
1 parent 0edcb15 commit 6857a98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Suggests:
rmarkdown,
RSQLite,
sf,
testthat (>= 3.0.0),
testthat (>= 3.2.0),
tibble,
tidygraph
VignetteBuilder:
Expand Down
7 changes: 3 additions & 4 deletions tests/testthat/test-clean-names.R
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,8 @@ test_that("Names are cleaned appropriately without attaching sf", {
# last column name
issue_578_sf <- readRDS("testdata/issue-578-sf.rds")
issue_578_sf_clean <- clean_names(issue_578_sf)
expect_error(
print(issue_578_sf_clean),
NA
expect_no_error(
print(issue_578_sf_clean)
)
})

Expand Down Expand Up @@ -724,5 +723,5 @@ test_that("groupings are preserved, #260", {
df_grouped <- iris %>% dplyr::group_by(Sepal.Length, Sepal.Width) # nonsense for analysis but doesn't matter
df_grouped_renamed <- df_grouped %>% clean_names(case = "lower_camel")
expect_equal(dplyr::group_vars(df_grouped_renamed), c("sepalLength", "sepalWidth")) # group got renamed
expect_equal(names(df_grouped_renamed), c("sepalLength", "sepalWidth", "petalLength", "petalWidth", "species"))
expect_named(df_grouped_renamed, c("sepalLength", "sepalWidth", "petalLength", "petalWidth", "species"))
})

0 comments on commit 6857a98

Please sign in to comment.