-
Notifications
You must be signed in to change notification settings - Fork 124
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
chore(trie): lib/trie/hash.go
tests
#2049
Conversation
03a0935
to
6673e86
Compare
91b3fe8
to
8274c87
Compare
Codecov Report
@@ Coverage Diff @@
## development #2049 +/- ##
===============================================
- Coverage 60.35% 60.15% -0.20%
===============================================
Files 200 194 -6
Lines 27013 26686 -327
===============================================
- Hits 16303 16053 -250
+ Misses 8801 8747 -54
+ Partials 1909 1886 -23
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
97a2391
to
330195b
Compare
8274c87
to
7c7b2c6
Compare
lib/trie
lib/trie/hash.go
tests
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
7c7b2c6
to
e7fbfe5
Compare
func TestHashBranch(t *testing.T) { | ||
n := &branch{key: generateRandBytes(380), value: generateRandBytes(380)} | ||
n.children[3] = &leaf{key: generateRandBytes(380), value: generateRandBytes(380)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add a test for random nodes as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? 🤔
I'm a big fan of deterministic tests.
Unless we need crypto randomness in certain niche cases (i.e.generate uniform distribution etc.)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me! how do you feel about adding more tests using generateRand
haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, lgtm!
🎉 This PR is included in version 0.6.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Changes
Tests
Issues
Primary Reviewer