-
Notifications
You must be signed in to change notification settings - Fork 140
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
Added test to partially ensure HashableValue does not regress #1431
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1431 +/- ##
=======================================
Coverage 73.01% 73.01%
=======================================
Files 288 288
Lines 39786 39786
=======================================
Hits 29048 29048
Misses 9263 9263
Partials 1475 1475
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:master commit 3ecb20d Results
|
Maybe something like this would be a good idea too: https://github.com/onflow/cadence/pull/1374/files#diff-4c8b1e88f5b478844aa7afa3c59c0f6fee63bb07b0bef8bfc6e974782fdff155R8 |
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.
Great idea to avoid regressions there! 👍
Given that HashInputTypeUFix64
is currently the last "case in the enum", but might not be in the future, when types are added, maybe add an additional case which just indicates the "count" / number of cases, and a comment indicating it always must be last, e.g.
// !!! *WARNING* !!!
// ADD NEW TYPES *BEFORE* THIS WARNING.
// DO *NOT* ADD NEW TYPES AFTER THIS LINE!
HashInputType_Count
)
And then use HashInputType_Count
in the new test case.
There are actually two more enumerations which have similar requirements. Could you please add the same "count case" there and a test case for each?
interpreter.CBORTag*
interpreter.PrimitiveStaticType
e9c8f65
to
dc21c50
Compare
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.
Great idea and work!
Closes nothing (just ran into this)
Description
While looking into another issue, I came across the warning in
hashablevalue.go
and figured it could use a quick test to catch a possible regression.I also added some language to the warning because it had a loophole.
master
branchFiles changed
in the Github PR explorer