Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for ClosureOnce. #41

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Add tests for ClosureOnce. #41

wants to merge 1 commit into from

Conversation

tov
Copy link
Owner

@tov tov commented Dec 20, 2021

We check that we can call a ClosureOnce once successfully, but calling it a second time is an error. Normally if this error occurs, the program exits (code 2), because it isn’t safe to panic when calling an FFI callback. However, in cfg(test) this error instead causes a panic, so that we can test the error using #[should_panic].

We check that we can call a ClosureOnce once successfully,
but it’s an error to call it twice. Normally if this error
occurs, the program exits (code 2), because it isn’t
safe to panic when calling a callback. However, in
cfg(test) this error results in a panic so that we can
test the error using #[should_panic].
@tov tov marked this pull request as draft December 20, 2021 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant