Skip to content
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

test: add capabilities test cases for trailing space handling #2505

Merged
merged 2 commits into from
Sep 16, 2023

Conversation

dgw
Copy link
Member

@dgw dgw commented Sep 4, 2023

Some IRCds include trailing space in capability lists, and this is not a spec violation. Default .split() behavior in Python should handle it fine, but it's also good to be explicit that we expect the default behavior, through tests.

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make lint and make test)
    • Success: no issues found in 82 source files
    • 1322 passed, 8 xfailed, 1 warning in 70.41s (0:01:10)
  • I have tested the functionality of the things this change touches

Notes

Inspired by ircv3/ircv3-specifications#530, which is not yet merged. However, since this is de facto behavior by UnrealIRCd and InspIRCd that isn't likely to change very soon even if the spec amendment is rejected, I think we should just add the tests.

Review requested from @Exirel specifically because the new capability system is his baby, and he's the most likely one to point out any incorrect assumptions I might have had about how to adapt existing test cases for this purpose.

Some IRCds include trailing space in capability lists, and this is not a
spec violation. Default `.split()` behavior in Python should handle it
fine, but it's also good to be explicit that we expect the default
behavior, through tests.
It's not much, but it's honest work.

I was going to do some type-hint cleanup too, but there are plenty of
warnings in the `test/` directory because we haven't been checking it.
That sort of work should be done in its own PR(s) rather than as
incidental cleanup "because I'm already touching this file".
Copy link
Contributor

@Exirel Exirel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, all good as far as I can tell.

@dgw
Copy link
Member Author

dgw commented Sep 16, 2023

Spec clarification was merged 🎉

@dgw dgw merged commit 274470e into master Sep 16, 2023
7 checks passed
@dgw dgw deleted the cap-trailing-space branch September 16, 2023 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants