-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
implement Path.Equals and Path.HasPrefix #25
Conversation
cacb556
to
fd27862
Compare
fd27862
to
d62f38c
Compare
Codecov Report
@@ Coverage Diff @@
## master #25 +/- ##
==========================================
+ Coverage 75.83% 75.89% +0.06%
==========================================
Files 74 74
Lines 5727 5750 +23
==========================================
+ Hits 4343 4364 +21
- Misses 995 996 +1
- Partials 389 390 +1
Continue to review full report at Codecov.
|
d62f38c
to
d60b66a
Compare
d60b66a
to
6deab8b
Compare
Updated to change Equals to be a strict equality match. Added Matches since it wasn't a strict equals comparison with the Unknown behavior. If we accept the |
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.
This makes sense to me! Thanks
I feel a little unsure about overloading unknown to mean a wildcard in Matches
since I could see a calling application inadvertently placing an unknown in that position after evaluating an expression to get the key, without intending it to be treated as a wildcard. I don't really have a better idea, so if we need that right now then I suppose we could run with it, but if we can split the bug fix (actual numbers aren't matching) from the idea of wildcards (a new feature entirely, I think?) then I'd prefer that to see if we can find a less ambiguous way to deal with the wildcard idea... 🤔
Heh, I took the idea of the Unknown "wildcard" from the documentation ;)
I did decide to split |
The path stuff here was extracted out of the otherwise-abandoned (and now split out until a separate repository) Unless we're planning to implement wildcards right now, I'd prefer to leave this out so we can design it all together along with whatever other downstream features end up needed for it. The Could we compromise and call this function |
|
6deab8b
to
2c62c22
Compare
Paths comparisons done with reflect.DeepEqual may erroneously return false for numeric IndexSteps, due to the differences in the internal values of the big.Float. Add Path.Equals method to ensure all IndexSteps compare correctly. Add Path.HasPrefix to test that one path is a prefix of another.
2c62c22
to
66e2eb3
Compare
Paths comparisons done with reflect.DeepEqual may erroneously return
false for numeric IndexSteps, due to the differences in the internal
values of the big.Float.