From 5a7caa4af671ae83483c0763d9fef787dbe3778c Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 21 Mar 2022 23:12:06 -0700 Subject: [PATCH] Use expect_type where appropriate Similar to #6211 -- caught with `lintr::expect_type_linter()`. --- tests/testthat/test-bind.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testthat/test-bind.R b/tests/testthat/test-bind.R index 17d83a75b4..38b9db7154 100644 --- a/tests/testthat/test-bind.R +++ b/tests/testthat/test-bind.R @@ -185,8 +185,8 @@ 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", { @@ -194,7 +194,7 @@ test_that("bind_rows() promotes factor to character with warning", { 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", {