diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-01 20:42:56 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-01 20:42:56 +0900 |
| commit | fe210391f59d5fe19d5c3d56d369ab7918117de1 (patch) | |
| tree | 4486d5945d241d0e6e8bf79072744cc0cca90cf4 /crates/mozart-test-harness/src | |
| parent | 8261abde3d9fb9ec1d764b912fa5487e4fcd9339 (diff) | |
| download | php-mozart-fe210391f59d5fe19d5c3d56d369ab7918117de1.tar.gz php-mozart-fe210391f59d5fe19d5c3d56d369ab7918117de1.tar.zst php-mozart-fe210391f59d5fe19d5c3d56d369ab7918117de1.zip | |
feat(registry): accept v1 (bare array) installed.json
Composer's FilesystemRepository::initialize branches on
isset($data['packages']) — object form is v2, bare array is v1 —
and treats dev-package-names/dev as optional. Mirror that in
InstalledPackages::read so Mozart consumes shared .test fixtures
(which use v1) without harness preprocessing, and so installs over
v1-era vendor directories keep working. Drop the v1→v2 wrapper
that was added to mozart-test-harness for the same reason.
Removes #[ignore] from update_to_empty_from_locked (2/187 green).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart-test-harness/src')
| -rw-r--r-- | crates/mozart-test-harness/src/runner.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/mozart-test-harness/src/runner.rs b/crates/mozart-test-harness/src/runner.rs index e041cd7..cefd50f 100644 --- a/crates/mozart-test-harness/src/runner.rs +++ b/crates/mozart-test-harness/src/runner.rs @@ -20,6 +20,11 @@ pub struct RunResult { /// Set up a temp project from the parsed test, invoke `mozart` with the /// `--RUN--` command, and capture the result. +/// +/// `--INSTALLED--` is written verbatim to `vendor/composer/installed.json`. +/// Composer's fixtures use the v1 plain-array shape (`[{...}]`), which +/// `FilesystemRepository::initialize` accepts alongside the v2 object shape; +/// Mozart's reader is expected to do the same. Do not pre-wrap here. pub fn run_test(test: &ParsedTest, mozart_bin: &Path) -> Result<RunResult> { let working_dir = TempDir::new().context("failed to create tempdir")?; let root = working_dir.path(); |
