WIP: Fix glob() directory wildcards and MakeMaker test pattern support#430
Merged
Conversation
Two bugs caused jcpan -t to silently find 0 tests for modules like
Excel::Writer::XLSX whose tests live in subdirectories (t/*/*.t):
1. ScalarGlobOperator: glob("t/*/*.t") returned nothing because
extractPathComponents() split on the last "/" and tried to open
"t/*" as a literal directory. Added recursive glob expansion that
processes each path segment independently, expanding wildcards in
directory components by listing and matching directory entries.
2. ExtUtils/MakeMaker.pm: The generated Makefile test target hardcoded
glob(q{t/*.t}), ignoring the test => { TESTS => '...' }
parameter from WriteMakefile(). Now extracts and uses the TESTS
pattern when provided.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…el::Writer::XLSX
- Fix split to evaluate arguments in SCALAR context (both JVM and
interpreter backends). `split //, reverse $str` now correctly
reverses the string instead of treating it as a list operation.
- Add \p{} and \P{} Unicode property support inside character classes
in regex preprocessing (RegexPreprocessorHelper).
- Add Emoticons Unicode block mapping in UnicodeResolver.
- Add Archive::Zip::setErrorHandler stub for compatibility.
- Add Excel::Writer::XLSX module tracking document.
Excel::Writer::XLSX test results: 1110/1247 programs pass,
4977/4982 subtests pass (99.9%).
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The CPAN Archive::Zip (line 12) does `use FileHandle ()`, which makes
the FileHandle class available to downstream modules. PerlOnJava's
custom Java-backed Archive::Zip omitted this, causing 133 test failures
in Excel::Writer::XLSX where Utility.pm calls FileHandle->new() without
an explicit `use FileHandle`.
Excel::Writer::XLSX results: 1243/1247 programs pass (99.7%),
5110/5115 subtests pass. Only 4 minor failures remain ('' vs undef
and Emoticons Unicode quoting).
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
In Perl, when a string has the UTF-8 flag set, \w, \d, \s use Unicode semantics even for characters in the Latin-1 range (e.g., e-acute U+00E9 should match \w). Previously, PerlOnJava only used the Unicode regex pattern for strings containing characters > U+00FF, causing Latin-1 accented characters like e-acute to fail \w matching. Fix: use the Unicode-aware compiled pattern whenever the input string has the UTF-8 flag, not just when it contains chars above U+00FF. This fixes quote_sheetname.t tests 15-16 in Excel::Writer::XLSX. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…aining work Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
In Perl, `open my $fh, '>', \$scalar` where $scalar is undef keeps it undef until something is actually written. PerlOnJava was eagerly setting it to '' on open, which caused Test::More::is() failures when comparing expected undef with actual ''. This fixes the last 5 failing subtests in Excel::Writer::XLSX, bringing it to 1247/1247 programs (5115/5115 subtests) passing. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
All 1247 programs and 5115 subtests now pass. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…-8 flag
Three fixes for regressions introduced by recent commits:
1. RuntimeIO: open '>' on read-only undef scalars (like \undef) now
correctly fails. The undef preservation fix skipped the set("")
call which also served as a read-only check. Now sets undef-to-undef
to trigger the check without changing the value.
2. CharacterClassMapper: [:punct:] now maps to [\p{P}\p{S}] instead
of \p{Punct}. Java's UNICODE_CHARACTER_CLASS flag changes \p{Punct}
to only match Unicode Punctuation category, excluding ASCII symbols
like +, <, =, >, $. Using \p{P}\p{S} covers both Punctuation and
Symbol categories, matching Perl's behavior. Net improvement: +24
tests on re/charset.t.
3. RuntimeHash/RuntimeHashProxyEntry: Track hash key byte/UTF-8 flags.
In Perl, hash keys preserve their byte/UTF-8 type which affects
regex \w matching semantics. Added byteKeys Set to RuntimeHash,
updated keys(), iterator, get(), delete(), and state management
to preserve key types. Fixes 2 regressions in op/utfhash.t.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The previous fix mapped [:punct:] to [\p{P}\p{S}] unconditionally, which
broke re/pat_advanced.t because non-Unicode patterns should only match
ASCII punctuation in the 0x80-0xFF range.
Now [:punct:] maps to \p{Punct} (correct ASCII behavior by default), and
the Unicode variant pattern replaces it with [\p{P}\p{S}] to include
symbols when UNICODE_CHARACTER_CLASS is active.
Results:
- re/pat_advanced.t: 1316/1678 (restored from 1315)
- re/charset.t: 5494/5552 (+8 over previous 5486)
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
c3ec3ed to
b7f3d2f
Compare
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.
Summary
Fix
glob()directory wildcards:glob("t/*/*.t")previously returned nothing because the implementation only expanded wildcards in the filename component (after the last/), treating everything before it as a literal directory path. Added recursive glob expansion that processes each path segment independently, expanding wildcards in directory components.Fix MakeMaker
testparameter: The generated Makefile test target hardcodedglob(q{t/*.t}), ignoring the module'stest => { TESTS => '...' }parameter fromWriteMakefile(). Now extracts and uses the custom TESTS pattern when provided.These two bugs combined caused
jcpan -t Excel::Writer::XLSXto silently reportFiles=0, Tests=0despite 1,247 test files existing in subdirectories (t/regression/*.t,t/chart/*.t, etc.).Test plan
makepasses (all unit tests)glob("t/*/*.t")returns 1,152 files in Excel::Writer::XLSX build dir (was 0)glob("t/*/*.t t/*/*/*.t")returns 1,247 files (the full set)src/test/resources/unit/*.t) still workjcpan -t Excel::Writer::XLSXactually runs tests (WIP)Generated with Devin