Skip to content

Commit 3cd6246

Browse files
committed
test of the keep_output
1 parent 5605340 commit 3cd6246

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/testthat/test-qenv_eval_code.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,10 @@ testthat::test_that("comments passed alone to eval_code that contain @linksto ta
186186
"x"
187187
)
188188
})
189+
190+
testthat::test_that("keep_output stores the last output of the `code` evaluation in its 'output' attribute", {
191+
q <- eval_code(qenv(), "a <- 1L;b <-2L;c<- 3L", keep_output = TRUE)
192+
testthat::expect_identical(attr(q@code[[1]], "output"), NULL)
193+
testthat::expect_identical(attr(q@code[[2]], "output"), NULL)
194+
testthat::expect_identical(attr(q@code[[3]], "output"), 3L)
195+
})

0 commit comments

Comments
 (0)