testwhat
testwhat copied to clipboard
Support environment-based checks in check_fun_def
Currently, testwhat
does not allow you to check the content of objects defined inside a function definition. In other words, in the example below, it is not possible to use check_object('c')
inside a check_fun_def()
-started tree.
my_fun <- function(a, b) {
c <- 4
return(a + b + c)
}
In pythonwhat
, this is possible, by manually specifying context values, and being able to run the body of a function definition etc. It is very tricky in pythonwhat
, and poorly understood by most (afaik), so if we do this in testwhat
, we should very carefully think about the API. cc @sumedh10
Kind-of duplicate of #161