Skip to content

Commit 2a4e86e

Browse files
Merge branch 'pr86' into develop
2 parents 4395db9 + 818c356 commit 2a4e86e

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

tests/with_progress.R

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,20 @@ if (requireNamespace("utils", quietly = TRUE)) {
167167
message("with_progress() - multiple handlers ... done")
168168

169169

170+
message("with_progress() - return value and visibility ...")
171+
172+
res <- with_progress(x)
173+
stopifnot(identical(x, res))
174+
175+
res <- withVisible(with_progress(x))
176+
stopifnot(identical(res$visible, TRUE))
177+
178+
res <- withVisible(with_progress(y <- x))
179+
stopifnot(identical(res$visible, FALSE))
180+
181+
message("with_progress() - return value and visibility ... done")
182+
183+
170184
message("with_progress() ... done")
171185

172186
source("incl/end.R")

tests/without_progress.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,19 @@ with_progress(without_progress(y <- slow_sum(x)))
1313

1414
message("without_progress() ... done")
1515

16+
17+
message("without_progress() - return value and visibility ...")
18+
19+
res <- without_progress(x)
20+
stopifnot(identical(x, res))
21+
22+
res <- withVisible(without_progress(x))
23+
stopifnot(identical(res$visible, TRUE))
24+
25+
res <- withVisible(without_progress(y <- x))
26+
stopifnot(identical(res$visible, FALSE))
27+
28+
message("without_progress() - return value and visibility ... done")
29+
30+
1631
source("incl/end.R")

0 commit comments

Comments
 (0)