You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is need in order for the Async version to work properly.
Without it, try_with with not return the exception raised by user, but instead an exception wrapper which does not play nice with testing.
Not being familiar with Async, my understanding is that extract_exn:true discards some backtrace and monitor information that might be helpful for debugging. In what sense does the exception wrapper not play nicely with testing?
In the sense that alcotest (apparently) uses exceptions when failing tests and uses the exception to display the problem (i.e. the function returned x instead of y in the case of an int function being tested). If not using extract_exn:true, this information is lost and you just see an unhelpful general exception.
It's true that Async's exception wrapping prevents exceptions raised by Alcotest.check from being properly displayed at the top-level, and adding extract_exn:true fixes this behaviour. Unfortunately, this also throws away stack trace information from user exceptions in tests (example).
I think a more granular solution is necessary to ensure that only Check_error exceptions are unwrapped in this way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is need in order for the Async version to work properly.
Without it,
try_withwith not return the exception raised by user, but instead an exception wrapper which does not play nice with testing.