Skip to content

Commit

Permalink
Add explicit 'filesize' test
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Oct 19, 2024
1 parent 9a8b43a commit 7bf7d3d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ Suggests:
VignetteBuilder: progressr
URL: https://progressr.futureverse.org, https://github.com/HenrikBengtsson/progressr
BugReports: https://github.com/HenrikBengtsson/progressr/issues
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
13 changes: 13 additions & 0 deletions man/progressr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions tests/handler_filesize.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
source("incl/start.R")

options(progressr.clear = FALSE)

options(progressr.handlers = handler_filesize)

message("handler_filesize() ...")

for (x in list(integer(0), 1:10, 1L)) {
message("length(x): ", length(x))
with_progress({
progress <- progressor(along = x)
for (ii in x) {
Sys.sleep(getOption("progressr.demo.delay", 0.1))
progress(message = sprintf("(%s)", paste(letters[1:ii], collapse="")))
}
})
}

message("handler_filesize() ... done")

source("incl/end.R")

0 comments on commit 7bf7d3d

Please sign in to comment.