Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Feb 14, 2025
1 parent be1ff9a commit de54356
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/testthat/test-get_datagrid.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ test_that("get_datagrid - data", {
expect_length(get_datagrid(x = iris$Sepal.Length), 10)
expect_length(get_datagrid(x = iris$Sepal.Length, length = 5), 5)
expect_length(get_datagrid(x = iris$Sepal.Length, length = NA), length(unique(iris$Sepal.Length)))
expect_identical(min(get_datagrid(x = iris$Sepal.Length, range = "iqr")), as.numeric(quantile(iris$Sepal.Length, 0.025))) # nolint
expect_identical(min(get_datagrid(x = iris$Sepal.Length, range = "hdi")), as.numeric(bayestestR::hdi(iris$Sepal.Length, ci = 0.95, verbose = FALSE))[2]) # nolint
expect_identical(min(get_datagrid(x = iris$Sepal.Length, range = "eti")), as.numeric(bayestestR::eti(iris$Sepal.Length, ci = 0.95, verbose = FALSE))[2]) # nolint
expect_identical(min(get_datagrid(x = iris$Sepal.Length, range = "iqr", digits = 15)), as.numeric(quantile(iris$Sepal.Length, 0.025))) # nolint
expect_identical(min(get_datagrid(x = iris$Sepal.Length, range = "hdi", digits = 15)), as.numeric(bayestestR::hdi(iris$Sepal.Length, ci = 0.95, verbose = FALSE))[2]) # nolint
expect_identical(min(get_datagrid(x = iris$Sepal.Length, range = "eti", digits = 15)), as.numeric(bayestestR::eti(iris$Sepal.Length, ci = 0.95, verbose = FALSE))[2]) # nolint
expect_length(get_datagrid(iris$Sepal.Length, by = "c(1, 3, 4)"), 3)
expect_length(get_datagrid(iris$Sepal.Length, by = "A = c(1, 3, 4)"), 3)
expect_length(get_datagrid(iris$Sepal.Length, by = "[1, 3, 4]"), 3)
expect_length(get_datagrid(iris$Sepal.Length, by = "[1, 4]"), 10)
expect_length(get_datagrid(iris$Sepal.Length, range = "sd", length = 10), 10)
expect_identical(as.numeric(get_datagrid(iris$Sepal.Length, range = "sd", length = 3)[2]), mean(iris$Sepal.Length))
expect_identical(as.numeric(get_datagrid(iris$Sepal.Length, range = "sd", length = 3)[2]), round(mean(iris$Sepal.Length), 3))

Check warning on line 166 in tests/testthat/test-get_datagrid.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-get_datagrid.R,line=166,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 127 characters.
expect_identical(as.numeric(get_datagrid(iris$Sepal.Length, range = "mad", length = 4)[2]), median(iris$Sepal.Length))

# Dataframes
Expand Down

0 comments on commit de54356

Please sign in to comment.