Merge pull request #2577 from hadley/print-methods

Implement two missing print methods
This commit is contained in:
Joe Cheng
2019-09-03 08:14:51 -07:00
committed by GitHub
6 changed files with 31 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