diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-25 16:27:53 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-26 00:20:05 +0900 |
| commit | 3a0d9340810a8808d963135a884f50d08442ac67 (patch) | |
| tree | 9fbed3350a23c791f52e37209095e0db41962c87 /crates/shirabe-class-map-generator/src/class_map_generator.rs | |
| parent | 46ac7242d526e13707dc140b7244e0fadf2219b9 (diff) | |
| download | php-shirabe-3a0d9340810a8808d963135a884f50d08442ac67.tar.gz php-shirabe-3a0d9340810a8808d963135a884f50d08442ac67.tar.zst php-shirabe-3a0d9340810a8808d963135a884f50d08442ac67.zip | |
test: port 59 autoload/vcs/installer/util/command tests; fix output capture
Port autoload_generator (24), bitbucket (14), suggested_packages (11),
git_driver (6), archive_manager (3), and a bump command test. Fix the
ApplicationTester output-capture root cause (php://memory streams must be
readable regardless of fopen mode). Implement posix_getuid/geteuid, the PCRE
'A' anchored modifier, php_strip_whitespace, stream_get_wrappers, is_callable
scalars; fix preg_quote angle-bracket escaping and class-map parser regexes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-class-map-generator/src/class_map_generator.rs')
| -rw-r--r-- | crates/shirabe-class-map-generator/src/class_map_generator.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/shirabe-class-map-generator/src/class_map_generator.rs b/crates/shirabe-class-map-generator/src/class_map_generator.rs index 5359f12..f591811 100644 --- a/crates/shirabe-class-map-generator/src/class_map_generator.rs +++ b/crates/shirabe-class-map-generator/src/class_map_generator.rs @@ -181,7 +181,14 @@ impl ClassMapGenerator { file_path = format!("{}/{}", cwd, file_path); file_path = Self::normalize_path(&file_path); } else { - file_path = Preg::replace(r"{(?<!:)[\\/]{2,}}", "/", &file_path); + // Regex pattern compatibility: + // PHP collapses runs of 2+ slashes/backslashes into one, except when the run is + // immediately preceded by `:` (to preserve scheme separators like `phar://`). The + // `regex` crate has no look-behind, so the `(?<!:)` guard is turned into a consuming + // optional leading group `(^|[^:])` that is re-emitted in the replacement. Slash runs + // are always separated by path-segment characters, so consuming the single preceding + // char never prevents an adjacent run from matching. + file_path = Preg::replace(r"{(^|[^:])[\\/]{2,}}", "${1}/", &file_path); } if file_path.is_empty() { |
