aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-17 04:55:59 +0900
committernsfisis <nsfisis@gmail.com>2026-08-17 04:55:59 +0900
commitea39e2301824435d45db88f95867dbe692aaf21e (patch)
treebb4a1210f34eb63b1b4965e7e5fc556ca87271ae /crates/shirabe/tests
parentbc79875f9a0cbacce94722fede76228b06486269 (diff)
downloadphp-shirabe-ea39e2301824435d45db88f95867dbe692aaf21e.tar.gz
php-shirabe-ea39e2301824435d45db88f95867dbe692aaf21e.tar.zst
php-shirabe-ea39e2301824435d45db88f95867dbe692aaf21e.zip
fix(platform): expand the %VAR% form in expand_path()
The alternation that stands in for the original conditional subpattern reports the branch it did not take as an empty string, so `dvar` was always present and won over `pvar`, leaving %VAR% unexpanded. `\w+` cannot capture an empty string, so an empty branch means it did not participate. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests')
-rw-r--r--crates/shirabe/tests/util/platform_test.rs3
1 files changed, 0 insertions, 3 deletions
diff --git a/crates/shirabe/tests/util/platform_test.rs b/crates/shirabe/tests/util/platform_test.rs
index 6c941ab2..be2764fe 100644
--- a/crates/shirabe/tests/util/platform_test.rs
+++ b/crates/shirabe/tests/util/platform_test.rs
@@ -4,9 +4,6 @@ use shirabe::util::platform::Platform;
use shirabe_php_shim::defined;
#[test]
-#[ignore = "Preg::replace_callback doesn't set PREG_UNMATCHED_AS_NULL, so the non-participating \
-alternation branch (dvar) is captured as an empty string instead of absent; Platform::expand_path's \
-matches.get(dvar).or_else(pvar) then picks the empty dvar over pvar for the %VAR% form"]
fn test_expand_path() {
Platform::put_env("TESTENV", "/home/test");
assert_eq!(