Skip to content

Commit

Permalink
add test for lnorm median and dispersion conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlambert committed Sep 20, 2024
1 parent 8b9aeeb commit 833868e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/testthat/_snaps/convert_params.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,31 @@
]
}

---

{
"type": "list",
"attributes": {
"names": {
"type": "character",
"attributes": {},
"value": ["meanlog", "sdlog"]
}
},
"value": [
{
"type": "double",
"attributes": {},
"value": [1.60943791]
},
{
"type": "double",
"attributes": {},
"value": [0.69314718]
}
]
}

---

{
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-convert_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ test_that("convert_summary_stats_to_params.character works as expected", {
convert_summary_stats_to_params("lnorm", median = 1, sd = 1),
style = "json2"
)
expect_snapshot_value(
convert_summary_stats_to_params("lnorm", median = 5, dispersion = 2),
style = "json2"
)
expect_snapshot_value(
convert_summary_stats_to_params("nbinom", mean = 1, dispersion = 1),
style = "json2"
Expand Down

0 comments on commit 833868e

Please sign in to comment.