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

circular-buffer: sync #1893

Merged
merged 2 commits into from
Apr 3, 2024
Merged

circular-buffer: sync #1893

merged 2 commits into from
Apr 3, 2024

Conversation

senekor
Copy link
Contributor

@senekor senekor commented Apr 2, 2024

[no important files changed]

Copy link
Contributor

github-actions bot commented Apr 2, 2024

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

@senekor senekor force-pushed the circular-buffer-sync branch from 0ec1a83 to 76c7b5b Compare April 2, 2024 15:10
Comment on lines +33 to +61
{#-
We usually do not add additional tests directly in the template.
In this case however, the structure of the tests is different from the
regular ones. Accommodating that in the template would be complicated
and unnecessary.
#}

#[test]
#[ignore]
fn clear_actually_frees_up_its_elements() {
let mut buffer = CircularBuffer::new(1);
let element = Rc::new(());
assert!(buffer.write(Rc::clone(&element)).is_ok());
assert_eq!(Rc::strong_count(&element), 2);
buffer.clear();
assert_eq!(Rc::strong_count(&element), 1);
}

#[test]
#[ignore]
fn dropping_the_buffer_drops_its_elements() {
let element = Rc::new(());
{
let mut buffer = CircularBuffer::new(1);
assert!(buffer.write(Rc::clone(&element)).is_ok());
assert_eq!(Rc::strong_count(&element), 2);
}
assert_eq!(Rc::strong_count(&element), 1);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is special

@senekor senekor requested a review from ErikSchierboom April 2, 2024 15:37
@senekor senekor merged commit 13fb84c into main Apr 3, 2024
10 checks passed
@senekor senekor deleted the circular-buffer-sync branch April 3, 2024 05:41
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.

2 participants