Implement print.reactivevalues

This commit is contained in:
Hadley Wickham
2019-09-03 09:13:43 -05:00
parent c9a0f0a713
commit a415aed7e6
5 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
> x <- reactiveValues(x = 1, y = 2, z = 3)
> x
<ReactiveValues>
Values: x, y, z
Readonly: FALSE

View File

@@ -122,6 +122,12 @@ test_that("ReactiveValues", {
expect_error(values$a <- 1)
})
test_that("reactiveValues() has useful print method", {
verify_output(test_path("print-reactiveValues.txt"), {
x <- reactiveValues(x = 1, y = 2, z = 3)
x
})
})
# Test for overreactivity. funcB has an indirect dependency on valueA (via
# funcA) and also a direct dependency on valueA. When valueA changes, funcB