tests/testthat/test-env.R

context("Find a function environment name")

test_that("Get environment name", {
    assign("f", function(x) x, envir = globalenv())
    expect_equal(get_envname("f"), "R_GlobalEnv")
    expect_equal(get_envname("prof.tree"), "prof.tree")
    expect_equal(get_envname("mean"), "base")
    expect_equal(get_envname(".try_quietly"), "tools")
    expect_equal(get_envname("parse_log"), "prof.tree")
})

Try the prof.tree package in your browser

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

prof.tree documentation built on May 2, 2019, 10:17 a.m.