Skip to content

Commit

Permalink
increasing test coverage after analyzing covr;:report().
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Fleischhacker authored and Adam Fleischhacker committed Aug 9, 2023
1 parent f762bd2 commit 00ae250
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/testthat/test-dag_edge.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ test_that("edge is created", {
expect_equal(listObj2$edges_df$from, 2)
expect_equal(listObj1$edges_df$to, 1)
expect_equal(listObj2$edges_df$to, 1)
listObj3 = dag_create() %>%
dag_node("Child Node","z") %>%
dag_node("Parent Node1","x") %>%
dag_node("Parent Node2","y") %>%
dag_edge(c("x","y"),"z")
expect_type(listObj3, "list")
})
18 changes: 18 additions & 0 deletions tests/testthat/test-dag_gretaDefunct.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
test_that("dag_greta gives warning", {
graph = dag_create() %>%
dag_node("Get Card","x",
rhs = bernoulli(theta),
data = carModelDF$getCard) %>%
dag_node("Signup Probability","theta",
rhs = uniform(0,1),
child = "x") %>%
dag_plate("Car Model", "y",
data = carModelDF$carModel,
nodeLabels = "theta",
addDataNode = TRUE) %>%
dag_plate("Observations", "i",
nodeLabels = c("x","y"))
mcmcCode = graph %>% dag_greta(mcmc = FALSE)
expect_type(mcmcCode, "NULL")
})

2 changes: 2 additions & 0 deletions tests/testthat/test-dag_numpyro.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ test_that("numpyro code is created", {
nodeLabels = c("x","y"))
mcmcCode = graph %>% dag_numpyro(mcmc = FALSE)
expect_type(mcmcCode, "character")
labelOut = meaningfulLabels(graph)
expect_type(labelOut, "NULL")
})

0 comments on commit 00ae250

Please sign in to comment.