tests/testthat/test-ctx_tree_draw.R

test_that("draw obeys its contract", {
  dts <- c(0, 1, 1, 1, 0, 0, 1, 0, 1, 0)
  dts_ctree <- ctx_tree(dts, min_size = 1, max_depth = 2)
  expect_snapshot_output(draw(dts_ctree))
  expect_snapshot_output(draw(dts_ctree, frequency = "total"))
  expect_snapshot_output(draw(dts_ctree, frequency = "detailed"))
  expect_snapshot_output(draw(dts_ctree, control = draw_control(root = "x", open_ct = "[", close_ct = "]", first_node = "*", next_node = "°", vbranch = "^", hbranch = "->"), frequency = "detailed"))
})

Try the mixvlmc package in your browser

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

mixvlmc documentation built on June 8, 2025, 12:35 p.m.