From a9b45cc01afa726bf9acd7f30ad3235593a258e2 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 16 Aug 2026 16:26:08 +0900 Subject: fix(autoload): expand the dirsep placeholder in target-dir patterns AutoloadGenerator.php builds the target-dir pattern by quoting the path with a marker in place of the separators, then replacing the quoted marker with [\\/]. The port kept that shape, but preg_quote() here deliberately leaves < and > alone so the regex crate does not read \< as a word boundary, so the replacement never matched and the pattern came out as the literal {^MainFoo}. A root package's target-dir was therefore never stripped from files, classmap or exclude-from-classmap, and dumping one failed outright. Split on the separators and quote each segment instead, so the marker never passes through preg_quote() at all. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/tests/autoload/autoload_generator_test.rs | 1 - 1 file changed, 1 deletion(-) (limited to 'crates/shirabe/tests/autoload') diff --git a/crates/shirabe/tests/autoload/autoload_generator_test.rs b/crates/shirabe/tests/autoload/autoload_generator_test.rs index 3f2c142c..4efcc7e0 100644 --- a/crates/shirabe/tests/autoload/autoload_generator_test.rs +++ b/crates/shirabe/tests/autoload/autoload_generator_test.rs @@ -589,7 +589,6 @@ fn test_root_package_autoloading_alternative_vendor_dir() { #[test] #[serial] -#[ignore = "autoload_real.php/autoload_static.php fixtures track a newer Composer template (single blank lines + $filesToLoad/$requireFile block) than the current AutoloadGenerator port emits; needs production template alignment"] fn test_root_package_autoloading_with_target_dir() { let mut s = set_up(); let package = new_root_pkg("root/a"); -- cgit v1.3.1-4-g156e