Skip to content

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

Merged
merged 1 commit into from
Oct 10, 2015
Merged

add exercise circular-buffer #52

merged 1 commit into from
Oct 10, 2015

Conversation

ekse
Copy link
Contributor

@ekse ekse commented Oct 8, 2015

The tests were ported from the Ruby version, the example implementation is similar to the Go example.


#[test]
#[ignore]
fn overwrite_item_in_full_buffer() {
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@EduardoBautista
Copy link
Contributor

We don't usually include the lib.rs file. Must have gotten accepted by accident in the "forth" exercise.

@ekse
Copy link
Contributor Author

ekse commented Oct 9, 2015

I can remove it, the reason I included was to provide the Error enum definition.

@EduardoBautista
Copy link
Contributor

@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.

@ekse
Copy link
Contributor Author

ekse commented Oct 10, 2015

I removed the lib.rs, I also merged the commits together.

@EduardoBautista
Copy link
Contributor

Looks good to me! Thanks!

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.

3 participants