Skip to content

Commit

Permalink
Namespace runif() calls
Browse files Browse the repository at this point in the history
Fixes #1656
  • Loading branch information
hadley committed Sep 20, 2022
1 parent dcada81 commit d3567be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/reporter-progress.R
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ ProgressReporter <- R6::R6Class("ProgressReporter",
self$rule("Terminated early", line = 2)
}

if (!self$show_praise || runif(1) > 0.1) {
if (!self$show_praise || stats::runif(1) > 0.1) {
return()
}

Expand Down
4 changes: 2 additions & 2 deletions R/reporter-summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ SummaryReporter <- R6::R6Class("SummaryReporter",

self$rule("DONE", line = 2)
if (self$show_praise) {
if (length(failures) == 0 && runif(1) < 0.1) {
if (length(failures) == 0 && stats::runif(1) < 0.1) {
self$cat_line(colourise(praise(), "success"))
}
if (length(failures) > 0 && runif(1) < 0.25) {
if (length(failures) > 0 && stats::runif(1) < 0.25) {
self$cat_line(colourise(encourage(), "error"))
}
}
Expand Down

0 comments on commit d3567be

Please sign in to comment.