-
-
Notifications
You must be signed in to change notification settings - Fork 277
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 missing test for encode_utf8 #683
Conversation
|
Thanks for your time, I add the |
I'm not sure if this PR adds something to our code base. To a reader there is a test called
If your goal is to add "random input to make sure bincode doesn't crash" then I think it's better to improve our fuzzing framework, that's what it exists for. To me it would make a lot more sense to, for example:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## trunk #683 +/- ##
==========================================
+ Coverage 57.30% 57.32% +0.01%
==========================================
Files 51 51
Lines 4335 4344 +9
==========================================
+ Hits 2484 2490 +6
- Misses 1851 1854 +3 ☔ View full report in Codecov by Sentry. |
Hi, thanks for your feedback. Sorry I did't find the correct place to in the existing unit test for the target function, I think it's better to merge this test in the following location(I will fix it shortly). Lines 36 to 39 in 73258a7
This PR is trying to add test coverage for the region shown above in the
Any utf8 with 4 length can fit to cover the region. This character is generated by machine so it doesn't have special meanings. I can create more examples for this test manually,
I will merge this test data into the existing testing frmework.
As mentioned above, the target function is tested but not fully covered, by adding this test, all the regions in the function is tested. BTW, this test is fully auto generated(from detection to the executable test), we just want to help improve the test coverage. If you feel uncomfortable about it 😔, feel free to close the PR, thanks for your time & patience.
I inspect the current fuzzing framework, I don't see the
These are good suggections, I can create more examples for this test manually. |
Hi,
Thanks for your time & patience to review this PR.
We are researchers focusing on Rust unit tests by LLM. By examine the existing code, we found a unit test can be added to improve the repo's overall unit test coverage(this project is already been well tested).
The code region to cover is:
bincode/src/enc/impls.rs
Lines 328 to 335 in 73258a7
Thanks again for reviewing.