rjbs / Number-Tolerant

perl library for numbers with built-in tolerances
3 stars 4 forks source link

Check defined-ness instead of truth in intersection() #7

Closed mjcarman closed 9 years ago

mjcarman commented 9 years ago

Patch for issue #6 including tests to detect the bug in pre-patched code. I used defined x ? x : y instead of x // y because N::T doesn't declare a minimum version and I didn't want to add a dependency on v5.10. (Though N::T does overload ~~, which was added in v5.10.)

rjbs commented 9 years ago

Thanks. You did not update the test count, meaning that tests failed on this commit! I have made the correction on my end, but please run the tests before submitting a PR.

Thanks for not using //. I target 5.8, in general. Semi-funny factoid: you can add overloading for ~~ in 5.8 because there's no warning on unknown overload keys yet. Otherwise, that overload would have been set up in a conditional.

I actually wrote a fix for this while reading #6, but your work is more thorough. This will be released immediately. Thanks!

mjcarman commented 9 years ago

Aw, man, that's embarrassing. I had updated the test count but since I don't have a git client on the PC I was on I used the web interface to copy my changes back to github. Lesson learned. :$ Thanks for fixing my flub.

rjbs commented 9 years ago

No problem at all. After all, your PR is fixing my flub!