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

test: ensure BytesMut::advance reduces capacity #728

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

camshaft
Copy link
Contributor

@camshaft camshaft commented Aug 2, 2024

This PR adds a test to ensure the behavior of BytesMut::advance is preserved in order to avoid #725.

I also confirmed that this test fails with the change from #698.

---- advance_bytes_mut_remaining_capacity stdout ----
testing capacity=0, len=0, advance=0
testing capacity=1, len=0, advance=0
testing capacity=1, len=1, advance=0
testing capacity=1, len=1, advance=1
thread 'advance_bytes_mut_remaining_capacity' panicked at tests/test_bytes.rs:701:17:
assertion `left == right` failed: Buf::advance should reduce the remaining capacity
  left: 1
 right: 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    advance_bytes_mut_remaining_capacity

@seanmonstar seanmonstar enabled auto-merge (squash) August 2, 2024 16:55
@camshaft
Copy link
Contributor Author

camshaft commented Aug 2, 2024

Looks like my brute force test is quite slow under miri. I think it's probably a good idea to reduce the search space a bit under that mode.

auto-merge was automatically disabled August 2, 2024 17:07

Head branch was pushed to by a user without write access

@seanmonstar seanmonstar enabled auto-merge (squash) August 2, 2024 18:57
@seanmonstar seanmonstar merged commit ed7d5ff into tokio-rs:master Aug 2, 2024
15 checks passed
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