tests/testthat/test_get_event_prob.R

context("Testing get_event_prob")

testthat::skip_on_cran()
testthat::test_that(

	desc = "Testing warnings",

	code = {
		model <- make_model("X -> Y")
		expect_error(get_event_prob(model = model, parameters = rnorm(6)),"Negative arguments for parameters not allowed")
	}
)


testthat::test_that(

	desc = "Testing hack",

	code = {
		model <- make_model("X -> Y") %>%
			set_restrictions(c("(X[]==1)", "(Y[X=.]==1)"))
		expect_true(row.names(get_event_prob(model = model))==colnames(get_ambiguities_matrix(model)))
	}
)

Try the CausalQueries package in your browser

Any scripts or data that you put into this service are public.

CausalQueries documentation built on Oct. 20, 2023, 1:06 a.m.