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
testscript: suggest misspelled commands #198
Conversation
Hm I just realized that this might create undesirable results for the |
Okay, second try :) Also over engineered the test a bit and actually found what's arguably a bug in handling invalid UTF-8 by better fuzzing. |
I propose #215 for the original problem :-) (and I'm ok if that doesn't get merged, though I think it's simple/straightforward, I'll maintain on my fork meanwhile) |
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 is quite a bit of added code, but it's useful and you've clearly put effort and polish into it, and I don't think it will cause additional maintenance burden of its own. SGTM with a couple of nits. There are conflicts as well, but I imagine they will be trivial.
I feel like there should be a test that the code in |
Look at files like |
6846479
to
1c0aeee
Compare
Added a couple simple tests and renamed the package PTAL |
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.
Thanks! Just one last nit about the tests.
If a command is not found, we go through the list of defined commands and check if any of them are sufficiently close to the one used. "Sufficiently close" is defined by having a Damerau-Levenshtein distance of 1, which feels like it hits the sweet spot between usefulness and ease of implementation. The negation case is still special-cased, as negation is not in the set of defined commands. Fixes rogpeppe#190
If a command is not found, we go through the list of defined commands and check if any of them are sufficiently close to the one used. "Sufficiently close" is defined by having a Damerau-Levenshtein distance of 1, which feels like it hits the sweet spot between usefulness and ease of implementation.
The negation case is still special-cased, as negation is not in the set of defined commands.
Fixes #190