-
Notifications
You must be signed in to change notification settings - Fork 82
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
Prevent null issues when strings are unequal #290
Conversation
In the case where s2 is larger than s1, this errors because the index is out of range. --- no changelog update needed
I'm going to fix up this unit testing framework a bit to be more usable, add some additional test cases for the string alignment function, and then merge. It might take a bit but I'll get it done. |
Sounds good! |
Okay, so I wrote some tests, and the test framework is very pretty now, but the tests are not passing... problem is, I'm pretty sure the tests are right and actually the string alignment algorithm has been wrong since I wrote it in 2019. Unfortunately I have no clue how it works anymore. So I will be figuring that out and fixing it, I guess. I bet that will solve #2... |
Aha, it WAS wrong!! And now it's fixed, I can't believe we've all (myself included) been living with the core algorithm of this package just being... wrong, for so long. Never again, I learned my lesson and will write tests. |
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.
✨
Sorry it took so long but I hope you'll agree the result is worth it! |
In the case where s2 is larger than s1, this errors because the index is out of range.
A good testcase is the below
If I've implemented the indexing wrong, do let me know but this seems to work just fine now for
mix
(the formatter that triggered this)