Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Aug 14, 2023
1 parent 4da94d5 commit b990e9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/test-row_means.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ test_that("row_means", {
expect_equal(row_means(d_mn, min_valid = 0.5), c(1.5, 2.75, NA, 5.66667), tolerance = 1e-3)
expect_equal(row_means(d_mn, min_valid = 0.75), c(NA, 2.75, NA, 5.66667), tolerance = 1e-3)
expect_equal(row_means(d_mn, min_valid = 2, digits = 1), c(1.5, 2.8, NA, 5.7), tolerance = 1e-1)
expect_message(row_means(iris), regex = "Only numeric")
expect_equal(row_means(iris, verbose = FALSE), rowMeans(iris[, 1:4]), tolerance = 1e-3, ignore_attr = TRUE)
})

test_that("row_means, errors or messages", {
data(iris)
expect_error(expect_warning(row_means(iris, select = "abc")), regex = "No columns")
expect_error(row_means(5, min_valid = 1), regex = "`data` must be")
expect_error(row_means(iris[1], min_valid = 1), regex = "two numeric")
expect_error(row_means(iris, min_valid = NULL), regex = "numeric value")
expect_error(row_means(iris, min_valid = 1:4), regex = "numeric value")
expect_error(row_means(iris, min_valid = "a"), regex = "numeric value")
expect_message(row_means(iris[1:3, ], min_valid = 3), regex = "Only numeric")
Expand Down

0 comments on commit b990e9f

Please sign in to comment.