We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3cd6246 commit 7e1f07aCopy full SHA for 7e1f07a
tests/testthat/test-qenv_within.R
@@ -154,3 +154,17 @@ testthat::test_that("Code executed with integer shorthand (1L) is the same as or
154
q <- within(qenv(), a <- 1L)
155
testthat::expect_identical(get_code(q), "a <- 1L")
156
})
157
+
158
+testthat::test_that("keep_output stores the last output of the `code` evaluation in its 'output' attribute", {
159
+ q <- within(qenv(),
160
+ {
161
+ a <- 1L
162
+ b <- 2L
163
+ c <- 3L
164
+ },
165
+ keep_output = TRUE
166
+ )
167
+ testthat::expect_identical(attr(q@code[[1]], "output"), NULL)
168
+ testthat::expect_identical(attr(q@code[[2]], "output"), NULL)
169
+ testthat::expect_identical(attr(q@code[[3]], "output"), 3L)
170
+})
0 commit comments