Skip to content

Commit

Permalink
add more sparse_median() tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilHvitfeldt committed Oct 14, 2024
1 parent 6c9b3ae commit 0880efd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/testthat/test-sparse_median.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ test_that("sparse_median() edge cases", {

expect_equal(median(x), sparse_median(x))

x <- sparse_double(c(10, NA), c(1, 2), 4)

expect_equal(median(x), sparse_median(x))
expect_equal(median(x, na.rm = TRUE), sparse_median(x, na_rm = TRUE))

x <- sparse_double(c(10, 10, NA), c(1, 2, 3), 5)

expect_equal(median(x), sparse_median(x))
Expand Down

0 comments on commit 0880efd

Please sign in to comment.