-
Notifications
You must be signed in to change notification settings - Fork 95
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
Adds tests for get_one #56
Adds tests for get_one #56
Conversation
Attempts to test both types of inner values - ValuesInner::Short and ValuesInner::Long.
Codecov Report
@@ Coverage Diff @@
## master #56 +/- ##
==========================================
+ Coverage 79.13% 80.82% +1.68%
==========================================
Files 11 11
Lines 997 1043 +46
==========================================
+ Hits 789 843 +54
+ Misses 208 200 -8
Continue to review full report at Codecov.
|
This is great, thank you! I left some comments :) |
And only tests! Hid the const from the docs to help dissuade clients from using it.
Also, slightly unrelated - I see the CI failing scarily (to someone who didn't know why). It seems like the version of |
Oh, yeah, good catch! If you want to include a quick fix for that in this PR too, that'd be great. |
Sorry, just saw this. Do you mind if I make it a new PR? I already had a new PR ready to go with the changes and figured it'd keep each PR's focus clean? But I'm also 100% down to combine them to reduce overhead! I could squash all the existing commits and then add the new commit that bumps the dependency version and not squash those two if you'd prefer 👍 Edit: |
Beautiful! I merged that PR, and squashed and merged this one. Thanks for all your work on this :D |
It's been my pleasure! Are there any other tests I should focus on next? Or any other things you've been wanting to get to but haven't had time? I really want to start contributing and learning/writing rust. Seeing as I've already learned a handful of things from this, I'd say continuing on would be fruitful. So I'm ready and rearing for anything you need or know about someone else needing! 👍 |
I think an awesome thing would be to adopt parts of the test suites from |
This PR
Attempting to help along with #31.
Notes
It appeared that
get_one
wasn't tested. I'm not sure if these tests are in the right place or if they should live inread/mod
. Or maybe this isn't tested because it's not valuable functionality? 🤷I tried to handle both inner cases -
ValuesInner::Short
andValuesInner::Long
. I'm not 100% sure it's necessary to testValuesInner::Long
because, although it's supported, it's clearly documented that, in the case of multiple values, the exact return value is not guaranteed. So it's nice to make sure it doesn't explode with multiple values but it also doesn't feel particularly useful asserting any particular returned value. I also feel pretty badly about the magic number with no hard-reference toBAG_THRESHOLD
.If we do want to improve the readability there, it looked like there was aIt looks like you can do something like:with_capacity
onOptions
but I didn't see one forevmap
so I wasn't sure how to do that idiomatically. I probably read the docs wrong.although maybe there's a slightly more compact method.
Finally, I don't know how to check code coverage before merging this so acknowledging that there's no guarantee the coverage will increase, I'm fine with just chucking this PR (but would still like to help if any more specific guidance is available!).Looks like it shows up right there in the PR! Neat!This change is