Skip to content

rust: delay: add coarse_sleep examples and tests #833

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

Merged
merged 1 commit into from
Jul 23, 2022

Conversation

ojeda
Copy link
Member

@ojeda ojeda commented Jul 22, 2022

While I was reviewing #823 I wrote a few assert!s to double-check I understood the logic, so why not add them as examples and tests?

We could avoid having to keep these in sync by making the conversion function public and moving the tests as # Examples, but I am not sure whether we want to expose another function. So, for the moment, at least add them as tests.

@alex
Copy link
Member

alex commented Jul 22, 2022

👍 code itself LGTM

@ojeda
Copy link
Member Author

ojeda commented Jul 22, 2022

Thanks @alex for the quick review!

I forgot to Cc @jbaublitz (by the way, GitHub does not appear to show you when I type @, probably because you are not part of the organization -- I just sent you the invitation).

@ojeda
Copy link
Member Author

ojeda commented Jul 23, 2022

Went with @alex suggestion after having improved the examples so that they are more clear when using the friendlier constructors, added a couple examples and separated them to make them easier to read, added saturations tests and added a mirror comment to keep things in sync.

@ojeda ojeda merged commit 61926cb into Rust-for-Linux:rust Jul 23, 2022
@ojeda ojeda deleted the msleep-tests branch July 23, 2022 15:06
@jbaublitz
Copy link

Sorry I couldn't get around to looking at this sooner but this looks reasonable to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants