Skip to content

docs: Perl::Tidy test support plan#468

Closed
fglock wants to merge 1 commit into
masterfrom
docs/perl-tidy-plan
Closed

docs: Perl::Tidy test support plan#468
fglock wants to merge 1 commit into
masterfrom
docs/perl-tidy-plan

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented Apr 9, 2026

Summary

Investigation of ./jcpan -t Perl::Tidy (v20260204) — currently 5/44 test files pass.

Blockers Identified

  • DESTROY singleton (Critical, 36 test files): Perl::Tidy::Formatter and Perl::Tidy::Tokenizer use closure-scoped instance counters decremented in DESTROY(). Since PerlOnJava does not call DESTROY, the counter never resets — the 2nd+ perltidy() call per process dies with "Attempt to create more than 1 object". Fix: 2-line overlay adding explicit _decrement_count() calls to Perl/Tidy.pm.
  • Option parsing (Moderate, ~5 tests): Options passed via perltidyrc => \ (e.g. -dac, -bl) are not applied. Likely a Getopt::Long negatable boolean (!) handling issue.
  • Wide character alignment (Low, 3 files): Unicode display width miscalculation in hash alignment.
  • EOL handling (Low, 1 file): t/test-eol.t produces no output.
  • DEBUG output (Low, 1 file): debugfile scalar ref returns undef.

Plan

Phase 1 (DESTROY fix) alone should bring results from 5/44 to ~35/44 files passing.

See dev/modules/perl_tidy.md for full analysis and implementation plan.

Test plan

  • Ran ./jcpan -t Perl::Tidy and captured all failures
  • Identified root causes for each failure category
  • Documented fix approach for each blocker

Generated with Devin

Investigation of ./jcpan -t Perl::Tidy (v20260204) identified 5 blockers:

1. DESTROY singleton (Critical): Formatter and Tokenizer use closure
   counters decremented in DESTROY. Since PerlOnJava does not call DESTROY,
   the 2nd+ perltidy() call per process dies. Affects 36/44 test files
   (~555 subtests). Fix: 2-line overlay in Perl/Tidy.pm.

2. Option parsing (Moderate): perltidyrc string ref options (-dac, -bl)
   not applied. Possibly Getopt::Long negatable boolean handling.

3. Wide char alignment (Low): Unicode display width miscalculation.

4. EOL handling (Low): t/test-eol.t produces no output.

5. DEBUG output (Low): debugfile scalar ref returns undef.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@fglock
Copy link
Copy Markdown
Owner Author

fglock commented Apr 9, 2026

Superseded by #469 which includes this doc commit plus the actual fixes.

@fglock fglock closed this Apr 9, 2026
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.

1 participant