SvenTiigi / WhatsNewKit

Showcase your awesome new app features 📱
https://sventiigi.github.io/WhatsNewKit/
MIT License
3.87k stars 190 forks source link

Make version comparison work correctly when minor or patch > 9 #43

Closed theoriginalbit closed 4 years ago

theoriginalbit commented 4 years ago

Minor and patch versions can be 10 or larger and the math that was used to compare versions would be incorrect in these cases. For example:

3.17.7 = 3 * 100 + 17 * 10 + 7 = 477
4.7.7  = 4 * 100 +  7 * 10 + 7 = 477

Instead this PR changes the code to perform a numeric comparison against the description strings.

I have added two additional tests, one which ensures the code can never regress to the above example, and a second which also just sanity checks equality.

SvenTiigi commented 4 years ago

Hey @theoriginalbit,

Great job 👍 Thanks for the bug fix!

Your PR has been merged and will be included within the next release of WhatsNewKit

theoriginalbit commented 4 years ago

No worries. Thanks for the quick merge. Look forward to seeing the next release 🙂

SvenTiigi commented 4 years ago

Hey @theoriginalbit,

Your PR is now available in the latest release of WhatsNewKit 1.3.5

Thanks for your contribution 🙌