Skip to content

Commit

Permalink
Add test for multiple NA input to row_number
Browse files Browse the repository at this point in the history
  • Loading branch information
matanhakim committed May 20, 2023
1 parent 9025f54 commit f7dfa8a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/testthat/test-row-to-names.R
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ test_that("find_header works within row_to_names", {

test_that("multiple rows input works", {

df_multiple_na <- example_data_row_to_names[[1]]
df_multiple_na[6:7, ] <- NA

expect_equal(
suppressWarnings(
row_to_names(example_data_row_to_names[[1]], row_number=1) %>%
Expand Down Expand Up @@ -279,4 +282,12 @@ test_that("multiple rows input works", {
c("Title_1_2_3", "Title2_4_5_6")
)

expect_equal(
suppressWarnings(
row_to_names(df_multiple_na, row_number=c(1,6,7), remove_rows_above = FALSE) %>%
names()
),
c("NA", "NA")
)

})

0 comments on commit f7dfa8a

Please sign in to comment.