test: add edge-case coverage for UTF-8 keys, regex, mixed types#144
Draft
Koan-Bot wants to merge 1 commit into
Draft
test: add edge-case coverage for UTF-8 keys, regex, mixed types#144Koan-Bot wants to merge 1 commit into
Koan-Bot wants to merge 1 commit into
Conversation
Add t/28-edge-cases.t with 69 tests covering previously untested code paths in Clone.xs: - UTF-8 hash key preservation (HeKUTF8 + negative klen in hv_store) - Regex (qr//) cloning with /i, /m, /s, /x modifiers - Mixed-type hash values (full sv_clone type switch) - Large hash correctness (hv_ksplit pre-sizing with 1000 keys) - Nested blessed objects at multiple levels - Shared reference identity preservation across clone graph - Deferred weakening with strong+weak refs to same target Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Add
t/28-edge-cases.twith 69 tests covering previously untested code paths.Why
Coverage analysis revealed several code paths in Clone.xs that lacked
explicit test coverage. While these paths work correctly today, regressions
could go unnoticed without dedicated tests — particularly for the UTF-8 key
handling path (HeKUTF8 + negative klen) and the hv_ksplit pre-sizing
optimization.
Test areas
— verifies both value correctness and UTF-8 flag preservation
— verifies both stringification and functional behavior
single structure (undef, IV, NV, PV, RV, AV, HV, CV, REGEXP)
— exercises hv_ksplit pre-sizing path
arrayrefs, and scalarrefs
a single clone
Testing
All 428 tests pass (29 files including this new one).
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com