testthat::test_that("get_code does not break if code uses quote", {
code <- c(
"expr <- quote(x <- x + 1)",
"x <- 0",
"eval(expr)"
)
tdata <- eval_code(teal_data(), code)
testthat::expect_identical(
get_code(tdata, datanames = "x"),
code[2]
)
})
Should get_code return whole code vector, or only code[2]. We know that x is used in quote which is later evaluated. So far we can overcome this with # @linksto x tag
Initially discussed in here https://github.com/insightsengineering/teal.data/pull/268#issuecomment-1906028844
For cases like below
Should
get_code
return wholecode
vector, or onlycode[2]
. We know thatx
is used inquote
which is later evaluated. So far we can overcome this with# @linksto x
tag