Skip to content

Commit

Permalink
add test for summarise draws
Browse files Browse the repository at this point in the history
  • Loading branch information
n-kall committed Mar 15, 2024
1 parent 2a8ae5e commit ded8b04
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/testthat/test-summarise_draws.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ test_that("summarise_draws works correctly", {
sum_x <- summarise_draws(x)
expect_true(is.na(sum_x[1, "q5"]))
expect_true(all(c("q5", "q95") %in% names(sum_x)))

sum_x <- summarise_draws(x, quantile2 = ~quantile2(.x, names = FALSE))
expect_true(all(c("quantile2.1", "quantile2.2") %in% names(sum_x)))

sum_x <- summarise_draws(x, mean, char = function(x) "char")
expect_double(sum_x[["mean"]])
expect_character(sum_x[["char"]])

})

test_that("aliases of summarise_draws work", {
Expand Down

0 comments on commit ded8b04

Please sign in to comment.