Skip to content

Commit ccd78e3

Browse files
author
Florence Bockting
committed
tests: update tests for better coverage
1 parent 6a9cb10 commit ccd78e3

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

tests/testthat/_snaps/compare.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@
7979
See ?`loo-glossary` (sections `diag_diff` and `diag_elpd`)
8080
or https://mc-stan.org/loo/reference/loo-glossary.html.
8181

82+
---
83+
84+
Code
85+
print(comp2, simplify = FALSE, p_worse = FALSE)
86+
Output
87+
model elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic se_waic
88+
model1 0.0 0.0 -83.5 4.3 3.3 1.1 167.1 8.5
89+
model2 -4.1 0.1 -87.6 4.3 11.2 1.1 175.2 8.6
90+
8291
# loo_compare returns expected result (3 models)
8392

8493
WAoAAAACAAQEAgACAwAAAAMTAAAADAAAABAAAAADAAQACQAAAAZtb2RlbDEABAAJAAAABm1v

tests/testthat/test_compare.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,7 @@ test_that("loo_compare returns expected results (2 models)", {
110110
expect_snapshot(print(comp2))
111111
expect_snapshot(print(comp2, p_worse = FALSE))
112112
expect_snapshot(print(comp2, simplify = FALSE))
113-
out_full <- paste(
114-
capture.output(suppressMessages(print(comp2, simplify = FALSE))),
115-
collapse = "\n"
116-
)
113+
expect_snapshot(print(comp2, simplify = FALSE, p_worse = FALSE))
117114

118115
# specifying objects via ... and via arg x gives equal results
119116
expect_equal(comp2, loo_compare(x = list(w1, w2)))

0 commit comments

Comments
 (0)