@@ -2,12 +2,12 @@ testthat::test_that("eval_code evaluates the code in the qenvs environment", {
22 q <- qenv()
33 q1 <- eval_code(q , quote(a <- 1L ))
44 q2 <- eval_code(q1 , quote(b <- 1 ))
5- testthat :: expect_equal(q2 @ .xData , list2env(list (a = 1L , b = 1 )))
5+ testthat :: expect_equal(q2 , list2env(list (a = 1L , b = 1 )))
66})
77
88testthat :: test_that(" eval_code locks the environment" , {
99 q <- eval_code(qenv(), quote(iris1 <- iris ))
10- testthat :: expect_true(environmentIsLocked(q @ .xData ))
10+ testthat :: expect_true(environmentIsLocked(q ))
1111})
1212
1313testthat :: test_that(" eval_code doesn't have access to environment where it's called" , {
@@ -36,13 +36,13 @@ testthat::test_that("getting object from the package namespace works even if lib
3636testthat :: test_that(" eval_code works with character" , {
3737 q1 <- eval_code(qenv(), " a <- 1" )
3838 testthat :: expect_identical(get_code(q1 ), " a <- 1" )
39- testthat :: expect_equal(q1 @ .xData , list2env(list (a = 1 )))
39+ testthat :: expect_equal(q1 , list2env(list (a = 1 )))
4040})
4141
4242testthat :: test_that(" eval_code works with expression" , {
4343 q1 <- eval_code(qenv(), expression(a <- 1 , b <- 2 ))
4444 testthat :: expect_identical(get_code(q1 ), " a <- 1\n b <- 2" )
45- testthat :: expect_equal(q1 @ .xData , list2env(list (a = 1 , b = 2 )))
45+ testthat :: expect_equal(q1 , list2env(list (a = 1 , b = 2 )))
4646testthat :: test_that(" eval_code preserves original formatting when `srcref` is present in the expression" , {
4747 code <- " # comment
4848 a <- 1L"
@@ -56,7 +56,7 @@ testthat::test_that("eval_code works with quoted", {
5656 q1 <- eval_code(qenv(), quote(a <- 1 ))
5757
5858 testthat :: expect_identical(get_code(q1 ), " a <- 1" )
59- testthat :: expect_equal(q1 @ .xData , list2env(list (a = 1 )))
59+ testthat :: expect_equal(q1 , list2env(list (a = 1 )))
6060})
6161
6262testthat :: test_that(" eval_code works with quoted code block" , {
@@ -72,7 +72,7 @@ testthat::test_that("eval_code works with quoted code block", {
7272 get_code(q1 ),
7373 c(" a <- 1\n b <- 2" )
7474 )
75- testthat :: expect_equal(q1 @ .xData , list2env(list (a = 1 , b = 2 )))
75+ testthat :: expect_equal(q1 , list2env(list (a = 1 , b = 2 )))
7676})
7777
7878testthat :: test_that(" eval_code fails with unquoted expression" , {
0 commit comments