Skip to content

fix: extract _expat_options to remove duplication#293

Draft
toddr-bot wants to merge 1 commit into
mainfrom
koan.toddr.bot/fix-issue-279
Draft

fix: extract _expat_options to remove duplication#293
toddr-bot wants to merge 1 commit into
mainfrom
koan.toddr.bot/fix-issue-279

Conversation

@toddr-bot

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

Copy link
Copy Markdown
Collaborator

Summary

Both parse() and parse_start() contained an identical 3-line loop filtering $self keys through Non_Expat_Options to build @expat_options. Extracted to a shared private method _expat_options.

Fixes #279

Changes

  • Added _expat_options() method that returns filtered key-value pairs using map/grep
  • Replaced duplicated loops in both parse() and parse_start() with calls to _expat_options()
  • Added t/expat_options_method.t with 4 tests covering filtering behavior and both call sites

Test plan

  • make test passes all 731 tests across 64 files
  • New test verifies Non_Expat_Options and Handlers are excluded from returned options
  • New test verifies both parse() and parse_start() produce working parsers through the shared method

Generated by Kōan /fix


Quality Report

Changes: 3 files changed, 291 insertions(+), 78 deletions(-)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

…arse_start()

Both methods had an identical loop filtering $self keys through
Non_Expat_Options. Extract to a shared private method.

Fixes #279

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.54%. Comparing base (ab2416c) to head (293728e).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #293      +/-   ##
==========================================
+ Coverage   76.40%   76.54%   +0.14%     
==========================================
  Files           1        1              
  Lines        1102     1113      +11     
  Branches      346      351       +5     
==========================================
+ Hits          842      852      +10     
  Misses         52       52              
- Partials      208      209       +1     
Flag Coverage Δ
perl 76.54% <ø> (+0.14%) ⬆️
xs 76.54% <ø> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a28ad1...293728e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

duplication: expat_options filtering loop copy-pasted between parse() and parse_start()

1 participant