From fe210391f59d5fe19d5c3d56d369ab7918117de1 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 1 May 2026 20:42:56 +0900 Subject: feat(registry): accept v1 (bare array) installed.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- crates/mozart-test-harness/src/runner.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crates/mozart-test-harness/src') 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 { let working_dir = TempDir::new().context("failed to create tempdir")?; let root = working_dir.path(); -- cgit v1.3.1