testwhat icon indicating copy to clipboard operation
testwhat copied to clipboard

Support environment-based checks in check_fun_def

Open filipsch opened this issue 6 years ago • 1 comments

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

filipsch avatar May 07 '18 10:05 filipsch

Kind-of duplicate of #161

filipsch avatar Sep 11 '18 11:09 filipsch