Skip to content

Commit

Permalink
Add tests to use tidyselect
Browse files Browse the repository at this point in the history
  • Loading branch information
Moohan committed Jul 23, 2024
1 parent 67728fa commit cb2ae09
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/testthat/test-get_simd_postcode.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,16 @@ test_that("col selection works", {
) |>
expect_message()
})

test_that("col selection works with tidyselect", {
expect_named(
get_simd_postcode(col_select = c("pc7", dplyr::starts_with("simd")))
) |>
expect_message()

expect_named(
get_simd_postcode(col_select = dplyr::matches("pc[78]")),
c("pc7", "pc8")
) |>
expect_message()
})
13 changes: 13 additions & 0 deletions tests/testthat/test-get_spd.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,16 @@ test_that("col selection works", {
) |>
expect_message()
})

test_that("col selection works with tidyselect", {
expect_named(
get_spd(col_select = c("pc7", dplyr::starts_with("hb")))
) |>
expect_message()

expect_named(
get_spd(col_select = dplyr::matches("pc[78]")),
c("pc7", "pc8")
) |>
expect_message()
})

0 comments on commit cb2ae09

Please sign in to comment.