Skip to content

Commit

Permalink
hedgehogqa#19 -- Only record information on expectation failure
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmuellegger committed Feb 22, 2024
1 parent f396924 commit 4772dfe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions R/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ run.prop <- function ( property, arguments, curry ) {

register_expectation <- function(e) {
e <- as.expectation(e)
test_error <<- e
ok <<- ok && expectation_ok(e)
e_ok <- expectation_ok(e)
ok <<- ok && e_ok

# Register first failure only.
if (isFALSE(e_ok) && is.null(test_error)) {
test_error <<- e
}
}

handle_error <- function(e) {
Expand Down

0 comments on commit 4772dfe

Please sign in to comment.