Skip to content

Add tests for Perl-level API edge cases#196

Draft
toddr-bot wants to merge 1 commit into
cpan-authors:mainfrom
toddr-bot:koan.toddr.bot/test-perl-api-edge-cases
Draft

Add tests for Perl-level API edge cases#196
toddr-bot wants to merge 1 commit into
cpan-authors:mainfrom
toddr-bot:koan.toddr.bot/test-perl-api-edge-cases

Conversation

@toddr-bot
Copy link
Copy Markdown
Contributor

@toddr-bot toddr-bot commented May 23, 2026

What

Add 34 tests covering four previously untested areas of the Perl API layer.

Why

The XS functions are well-tested, but several Perl-level behaviors had no
coverage: the check validation option, the SSLv23 fallback stub,
subclassing through all constructors, and binary data with NUL bytes.

How

New test file t/perl_api.t covers:

  • new_key_from_parameters(check => 1) — valid key passes, public key skips check
  • use_sslv23_padding() fallback — verifies croak on 3.x, success on pre-3.x
  • Subclassinggenerate_key, new_private_key, new_public_key,
    new_key_from_parameters all return correctly blessed subclass objects;
    encrypt/decrypt/sign/verify work through the subclass
  • Binary payloads — NUL bytes, all-zero data, single byte in
    encrypt/decrypt, sign/verify, and private_encrypt/public_decrypt

Testing

All 34 tests pass on OpenSSL 3.5.1. Full existing test suite passes with no regressions.

🤖 Generated with Claude Code


Quality Report

Changes: 1 file changed, 229 insertions(+)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

Cover four previously untested areas:
- new_key_from_parameters() with check => 1 option
- use_sslv23_padding() fallback behavior on OpenSSL 3.x
- Subclassing through all constructors and operations
- Binary payloads with NUL bytes in encrypt/decrypt/sign/verify

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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