Extend execution-error assertion macros with patter and any arms#2897
Extend execution-error assertion macros with patter and any arms#2897marijamijailovic wants to merge 3 commits into
Conversation
|
@marijamijailovic Would you mind fixing the broken lint workflow? Seems like something is ill-formatted. |
969c4de to
0702a68
Compare
|
|
Changelog check is failing now – should we add the |
PhilippGackstatter
left a comment
There was a problem hiding this comment.
Looks good! I left a few small comments.
7fa6311 to
58ee194
Compare
PhilippGackstatter
left a comment
There was a problem hiding this comment.
Looks good to me, thank you!
58ee194 to
9b783c5
Compare
|
@marijamijailovic could you please not force push in the future, especially after the changes have already been reviewed? Incremental changes are much easier to review, while a force push looks suspicious as the contributor might have pushed completely unrelated malicious code (not saying this is the case here but just regarding the process). Thanks! |
Sorry about that and thanks for pointing it out @mmagician. I’ll stick to incremental commits after reviews. |
Closes #2807
Adds two new arms to
assert_execution_error!andassert_transaction_executor_error!:matches <pat> [if <guard>]- pattern-match the innerExecutionErrordirectly, with an optional guard. Useful for variants other thanFailedAssertion, or to assert on a specificerr_code.any- accept anyErr.The existing
$expectedarm still works as before; tests passingMasmErrorconstants don't change.New
tests/assertion_macros.rs:#[should_panic]checks for the failure paths.FastProcessorto trigger and assert realExecutionErrorvariants end-to-end (DivideByZero,CycleLimitExceeded,MemoryError::UnalignedWordAccess,AdviceError::StackReadFailed,EventError, etc).