Skip to content

Commit

Permalink
Use expect_type where appropriate
Browse files Browse the repository at this point in the history
Similar to tidyverse#6211 -- caught with `lintr::expect_type_linter()`.
  • Loading branch information
MichaelChirico authored Mar 22, 2022
1 parent 8abb54b commit 5a7caa4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/testthat/test-bind.R
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,16 @@ test_that("bind_rows() promotes integer to numeric", {
df2 <- tibble(a = 1, b = 1L)

res <- bind_rows(df1, df2)
expect_equal(typeof(res$a), "double")
expect_equal(typeof(res$b), "integer")
expect_type(res$a, "double")
expect_type(res$b, "integer")
})

test_that("bind_rows() promotes factor to character with warning", {
df1 <- tibble(a = factor("a"))
df2 <- tibble(a = "b")

res <- bind_rows(df1, df2)
expect_equal(typeof(res$a), "character")
expect_type(res$a, "character")
})

test_that("bind_rows() coerces factor when levels don't match", {
Expand Down

0 comments on commit 5a7caa4

Please sign in to comment.