Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Dec 2, 2024
1 parent d6e24ca commit 9dd1763
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Suggests:
metafor,
metaplus,
mgcv,
mice,
mice (>= 3.17.0),
mlogit,
mmrm,
modelbased,
Expand Down
4 changes: 2 additions & 2 deletions R/get_statistic.R
Original file line number Diff line number Diff line change
Expand Up @@ -1549,8 +1549,8 @@ get_statistic.mipo <- function(x, ...) {
stringsAsFactors = FALSE
)
# check for ordinal-alike models
if ("y.level" %in% colnames(s)) {
params$Response <- as.vector(s$y.level)
if (!is.null(x$pooled) && "y.level" %in% colnames(x$pooled)) {
params$Response <- as.vector(x$pooled$y.level)
}
out <- text_remove_backticks(params)
attr(out, "statistic") <- find_statistic(x)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-mipo.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ test_that("param", {
out1$Estimate <- round(out1$Estimate, 4)
out2$Statistic <- round(out2$Statistic, 4)
expect_equal(out1$Response, c("6", "6", "6", "8", "8", "8"))

Check warning on line 21 in tests/testthat/test-mipo.R

View workflow job for this annotation

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

file=tests/testthat/test-mipo.R,line=21,col=3,[expect_identical_linter] Use expect_identical(x, y) by default; resort to expect_equal() only when needed, e.g. when setting ignore_attr= or tolerance=.
expect_equal(out2$Response, c("6", "6", "6", "8", "8", "8"))

Check warning on line 22 in tests/testthat/test-mipo.R

View workflow job for this annotation

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

file=tests/testthat/test-mipo.R,line=22,col=3,[expect_identical_linter] Use expect_identical(x, y) by default; resort to expect_equal() only when needed, e.g. when setting ignore_attr= or tolerance=.
expect_snapshot(out1)
expect_snapshot(out2)
expect_identical(find_parameters(pooled), list(conditional = c("(Intercept)", "disp", "hp")))
Expand Down

0 comments on commit 9dd1763

Please sign in to comment.