diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-07-24 20:22:54 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-07-24 20:22:54 +0900 |
| commit | 08a99447445167e2b2eeee9c81fc89d5044bfe6d (patch) | |
| tree | 2879c98a7b62a0834e0524dde6d60ba6f498988a /crates/shirabe/src/io/console_io.rs | |
| parent | 384b81c86d371e7247f2b7e7a5f3b6f5a5f1c919 (diff) | |
| download | php-shirabe-08a99447445167e2b2eeee9c81fc89d5044bfe6d.tar.gz php-shirabe-08a99447445167e2b2eeee9c81fc89d5044bfe6d.tar.zst php-shirabe-08a99447445167e2b2eeee9c81fc89d5044bfe6d.zip | |
fix(installer-test): classify EXPECT-LOCK by PHP truthiness, not string match
PHP's readTestFile splits sections with a regex that leaves a section's
own trailing newline attached when it is the file's last section
(verified against real PHP); for install-without-lock.test and
update-without-lock.test, --EXPECT-LOCK-- is that last section, so its
raw content is "false\n", not "false". PHP's `$expectLock === 'false'`
check therefore also misses, but PHP falls through to
JsonFile::parseJson("false\n"), which json_decodes to boolean false
anyway, and every downstream check in doTestIntegration branches on
PHP truthiness of $expectLock, so the outcome is unaffected either way.
The Rust port only mirrored the literal string comparison, so the
same "false\n" produced ExpectLock::Json(Value::Bool(false)) instead
of ExpectLock::Never, and do_test_integration's Json arm unconditionally
read composer.lock, panicking because config.lock=false means no lock
file is ever written. Parse EXPECT-LOCK as JSON first and classify by
PHP truthiness of the result, matching what doTestIntegration actually
checks instead of the raw string.
Diffstat (limited to 'crates/shirabe/src/io/console_io.rs')
0 files changed, 0 insertions, 0 deletions
