irc.utils, test: also remove null (\x00) in safe() #2620
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #2566.
In
test_irc_utils
suite, rewrotetest_safe
andtest_safe_bytes
to generate a bunch more permutations of invalid characters automatically rather than writing them all out. The horse is definitely beaten far past death at this point... but the tests sure are thorough(bred).Also renamed
test_safe_null
->test_safe_none
to avoid confusion;test_safe
andtest_safe_bytes
are the cases that check behavior with null characters/bytes. Python's docs technically do refer toNone
as the "null object" once or twice, but most of the docs (and most of us devs) simply call itNone
.Checklist
make qa
(runsmake lint
andmake test
)make lint
myself, and tried out the test runner integration in VS Code / Gitpod. Very slick; made iterating my updated tests much easier without always tabbing back to the terminal.Notes
This could go into 8.0.1, but I don't really want to mess around with hotfixes unless there's a major bug. I'm open to suggestions for improving the maintenance-branch workflow; since
master
is de facto for 8.1.0 dev now, the options are to keep the8.0.x
branch unprotected so I can push cherry-picks to it directly, or make @sopel-irc/rockstars review the same PR twice (once tomaster
, once to8.0.x
) for full CI coverage. I don't love either of those.