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

irc.utils, test: also remove null (\x00) in safe() #2620

Merged
merged 3 commits into from
Oct 22, 2024

Commits on Sep 14, 2024

  1. irc.utils, test: also remove null (\x00) in safe()

    In `test_irc_utils` suite, rewrote `test_safe` and `test_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` and `test_safe_bytes` are the cases that check behavior with
    null characters/bytes. Python's docs technically do refer to `None` as
    the "null object" once or twice, but most of the docs (and most of us
    devs) simply call it `None`.
    dgw committed Sep 14, 2024
    Configuration menu
    Copy the full SHA
    1cd02c4 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2024

  1. test: eliminate for...in loops in test_irc_utils suite

    Using `pytest.mark.parametrize()` instead. Two test cases become 12.
    
    Note: Yes, it is possible to have pytest treat each tuple generated by
    `itertools.permutations()` as a single argument. Doing so yields useless
    generated test-case names like `test_safe[seq0]`, though. Using three
    separate test parameters of simple types (`str` or `bytes`) yields more
    informative names like `test_safe[\n-\r-\x00]`.
    dgw committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    0e44186 View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2024

  1. irc.utils: improve safe() docstring

    Link to RFC explaining why CR, LF, and NUL are prohibited, and annotate
    the version in which NUL stripping was added.
    dgw committed Oct 13, 2024
    Configuration menu
    Copy the full SHA
    db4b296 View commit details
    Browse the repository at this point in the history