racket / rackunit

Other
18 stars 32 forks source link

Fix some failures discovered in PR #138 discussion #142

Closed AlexKnauth closed 3 years ago

AlexKnauth commented 3 years ago

When an exn is raised, use the check-info stack at the point the exception was raised, not the one at the point (current-check-around) was called.

This fixes the standalone.rkt failure about the presence of the params check-info if an error happens within the body of a check.

It doesn't really fix the define-check infos are added before calling current-check-around failure in check-info-test.rkt about the order of the params check-info relative to a custom check-info added by a user-defined current-check-around, instead it modifies the test to be less strict about the check-info/check-around order.

notjack:

short answer: there needs to be a way for the code throwing the exception to communicate the check info stack at the time the exception is created to the current-check-around handler. If it’s a regular check failure created with fail-check, then fail-check will capture the current info stack and throw an instance of exn:test:check with the current continuation marks and the current info stack. But if it’s any other kind of exception, like a run-of-the-mill contract error, the info stack isn’t a field of the exception…. but the current info stack is a parameter, and parameters are stored in the continuation marks anyway, so it should be possible to get the current-check-info parameter’s value directly from the mark set.

samth commented 3 years ago

It looks like the CI problems still haven't been fixed, which is why the tests seem to be failing.

samth commented 3 years ago

I've merged this. We'll see whether this breaks anything on DrDr, after which I'll merge this to the release branch.