tests/tinytest/test-tree.R

source("helpers.R")

expect_error(
  tree_new(),
  "Must pass either `txt` or `file`."
)

expect_error(
  tree_new(1),
  "`txt` must a be a string of length 1."
)

expect_error(
  tree_new(c("a", "b")),
  "`txt` must a be a string of length 1."
)

expect_error(
  tree_new(TRUE),
  "`txt` must a be a string of length 1."
)

expect_error(
  tree_root("a"),
  "`x` must be an object of class 'SgRoot'."
)

Try the astgrepr package in your browser

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

astgrepr documentation built on June 8, 2025, 11:05 a.m.