Skip to content

Commit

Permalink
Pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jcheng5 committed Dec 4, 2024
1 parent 16b5b31 commit 1b30d6e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 27 deletions.
2 changes: 2 additions & 0 deletions R/conditions.R
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ printStackTrace <- function(cond,
offset = offset
)
}
# No mapply return value--we're just printing
NULL
},
SIMPLIFY = FALSE
)
Expand Down
52 changes: 26 additions & 26 deletions tests/testthat/_snaps/stacks-deep.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
: stop
: onFinally [test-stacks-deep.R#XXX]
: onFulfilled
: callback [conditions.R#XXX]
: callback
: <Anonymous>
: onFulfilled
: handleFulfill
: <Anonymous>
: execCallbacks
: later::run_now
: wait_for_it [mock-session.R#XXX]
: wait_for_it
: eval [test-stacks-deep.R#XXX]
: eval
: test_code
Expand All @@ -36,14 +36,14 @@
: promise$finally
: finally
: onRejected [test-stacks-deep.R#XXX]
: callback [conditions.R#XXX]
: callback
: <Anonymous>
: onRejected
: handleReject
: <Anonymous>
: execCallbacks
: later::run_now
: wait_for_it [mock-session.R#XXX]
: wait_for_it
: eval [test-stacks-deep.R#XXX]
: eval
: test_code
Expand All @@ -66,14 +66,14 @@
: catch
: %...!%
: onFulfilled [test-stacks-deep.R#XXX]
: callback [conditions.R#XXX]
: callback
: <Anonymous>
: onFulfilled
: handleFulfill
: <Anonymous>
: execCallbacks
: later::run_now
: wait_for_it [mock-session.R#XXX]
: wait_for_it
: eval [test-stacks-deep.R#XXX]
: eval
: test_code
Expand Down Expand Up @@ -119,7 +119,7 @@
: onFinally [test-stacks-deep.R#XXX]
: onFulfilled
: withCallingHandlers
: callback [conditions.R#XXX]
: callback
: force
: reenter_promise_domain
: <Anonymous>
Expand All @@ -137,7 +137,7 @@
: <Anonymous>
: execCallbacks
: later::run_now
: wait_for_it [mock-session.R#XXX]
: wait_for_it
: eval [test-stacks-deep.R#XXX]
: eval
: withCallingHandlers
Expand Down Expand Up @@ -187,7 +187,7 @@
: finally
: onRejected [test-stacks-deep.R#XXX]
: withCallingHandlers
: callback [conditions.R#XXX]
: callback
: force
: reenter_promise_domain
: <Anonymous>
Expand All @@ -205,7 +205,7 @@
: <Anonymous>
: execCallbacks
: later::run_now
: wait_for_it [mock-session.R#XXX]
: wait_for_it
: eval [test-stacks-deep.R#XXX]
: eval
: withCallingHandlers
Expand Down Expand Up @@ -256,7 +256,7 @@
: %...!%
: onFulfilled [test-stacks-deep.R#XXX]
: withCallingHandlers
: callback [conditions.R#XXX]
: callback
: force
: reenter_promise_domain
: <Anonymous>
Expand All @@ -274,7 +274,7 @@
: <Anonymous>
: execCallbacks
: later::run_now
: wait_for_it [mock-session.R#XXX]
: wait_for_it
: eval [test-stacks-deep.R#XXX]
: eval
: withCallingHandlers
Expand Down Expand Up @@ -323,9 +323,9 @@
: then
: %...>%
: withCallingHandlers [test-stacks-deep.R#XXX]
: domain$wrapSync [conditions.R#XXX]
: domain$wrapSync
: promises::with_promise_domain
: captureStackTraces [conditions.R#XXX]
: captureStackTraces
: as.promise
: catch
: %...!%
Expand Down Expand Up @@ -371,14 +371,14 @@
Error in onFulfilled: boom
: stop
: onFulfilled [test-stacks-deep.R#XXX]
: callback [conditions.R#XXX]
: callback
: <Anonymous>
: onFulfilled
: handleFulfill
: <Anonymous>
: execCallbacks
: later::run_now
: wait_for_it [mock-session.R#XXX]
: wait_for_it
: eval [test-stacks-deep.R#XXX]
: eval
: test_code
Expand All @@ -401,14 +401,14 @@
: %...>%
: J__ [test-stacks-deep.R#XXX]
: onFulfilled
: callback [conditions.R#XXX]
: callback
: <Anonymous>
: onFulfilled
: handleFulfill
: <Anonymous>
: execCallbacks
: later::run_now
: wait_for_it [mock-session.R#XXX]
: wait_for_it
: eval [test-stacks-deep.R#XXX]
: eval
: test_code
Expand All @@ -431,14 +431,14 @@
: %...>%
: I__ [test-stacks-deep.R#XXX]
: onFulfilled
: callback [conditions.R#XXX]
: callback
: <Anonymous>
: onFulfilled
: handleFulfill
: <Anonymous>
: execCallbacks
: later::run_now
: wait_for_it [mock-session.R#XXX]
: wait_for_it
: eval [test-stacks-deep.R#XXX]
: eval
: test_code
Expand Down Expand Up @@ -482,14 +482,14 @@
Error in onFulfilled: boom
: stop
: onFulfilled [test-stacks-deep.R#XXX]
: callback [conditions.R#XXX]
: callback
: <Anonymous>
: onFulfilled
: handleFulfill
: <Anonymous>
: execCallbacks
: later::run_now
: wait_for_it [mock-session.R#XXX]
: wait_for_it
From earlier call:
: domain$wrapOnFulfilled
: promiseDomain$onThen
Expand All @@ -503,14 +503,14 @@
[No stack trace available]
From earlier call:
: onFulfilled [test-stacks-deep.R#XXX]
: callback [conditions.R#XXX]
: callback
: <Anonymous>
: onFulfilled
: handleFulfill
: <Anonymous>
: execCallbacks
: later::run_now
: wait_for_it [mock-session.R#XXX]
: wait_for_it
From earlier call:
: domain$wrapOnFulfilled
: promiseDomain$onThen
Expand All @@ -521,14 +521,14 @@
: %...>%
: B__ [test-stacks-deep.R#XXX]
: onFulfilled
: callback [conditions.R#XXX]
: callback
: <Anonymous>
: onFulfilled
: handleFulfill
: <Anonymous>
: execCallbacks
: later::run_now
: wait_for_it [mock-session.R#XXX]
: wait_for_it
From earlier call:
: domain$wrapOnFulfilled
: promiseDomain$onThen
Expand Down
7 changes: 6 additions & 1 deletion tests/testthat/test-stacks-deep.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ formatError <- function(err, full = FALSE, offset = TRUE, cleanPaths = TRUE) {
#
# This is to make the snapshot tests more stable across different machines and
# ignores benign code movement within a file.
str <- sub("\\[(.*/)?(.+?\\.R)#\\d+\\]", "[\\2#XXX]", str, perl = TRUE)
str <- sub("#\\d+\\]$", "#XXX]", str, perl = TRUE)
# Remove any file/line number reference that's not test-stacks-deep.R. These
# are just too inconsistent across different ways of invoking testthat--not
# relative vs. absolute paths, but whether the file/line number is included at
# all!
str <- sub("\\[(?!test-stacks-deep.R)[^[]+#XXX\\]", "", str, perl = TRUE)
# The frame numbers vary too much between different ways of invoking testthat
# ("Run Tests" editor toolbar button and "Test" Build tab button in RStudio,
# devtools::test(), etc.) so we blank them out.
Expand Down

0 comments on commit 1b30d6e

Please sign in to comment.