-
Notifications
You must be signed in to change notification settings - Fork 544
add exercise circular-buffer #52
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 exercise circular-buffer #52
Conversation
|
||
#[test] | ||
#[ignore] | ||
fn overwrite_item_in_full_buffer() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe could add a test for using overwrite in a non-full buffer too (like in Ruby) - create with size 2, write 1, overwrite 2, read should return 1 instead of 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, I will add this test tonight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the test. I actually had a bug in there due to a typo, oopsies.
We don't usually include the |
I can remove it, the reason I included was to provide the Error enum definition. |
@ekse I don't think it's too unreasonable to expect the Enum to be defined as a part of the exercise. If you can remove it, please do. |
I removed the lib.rs, I also merged the commits together. |
Looks good to me! Thanks! |
add exercise circular-buffer
The tests were ported from the Ruby version, the example implementation is similar to the Go example.