diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-27 04:34:46 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-27 04:35:36 +0900 |
| commit | f07202e69b389759cebed5a203756a1c66177e37 (patch) | |
| tree | 566fe68fa3b8b76ae64f40f9d92b11a3ef6c2a0b /crates/shirabe/tests/command | |
| parent | 2b51554ff59d1e5cbf8dd2db65d278b0202a9102 (diff) | |
| download | php-shirabe-f07202e69b389759cebed5a203756a1c66177e37.tar.gz php-shirabe-f07202e69b389759cebed5a203756a1c66177e37.tar.zst php-shirabe-f07202e69b389759cebed5a203756a1c66177e37.zip | |
fix(validate-command): release Composer borrow before dispatching CommandEvent
Holding a RefMut<Composer> across execute() conflicted with the shared
borrow taken inside EventDispatcher::get_script_listeners, panicking with
"RefCell already mutably borrowed". All accessors used here take &self, so
a shared borrow suffices.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/command')
| -rw-r--r-- | crates/shirabe/tests/command/validate_command_test.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/shirabe/tests/command/validate_command_test.rs b/crates/shirabe/tests/command/validate_command_test.rs index 5167fc0..933a0ff 100644 --- a/crates/shirabe/tests/command/validate_command_test.rs +++ b/crates/shirabe/tests/command/validate_command_test.rs @@ -72,10 +72,15 @@ fn provide_validate_tests() -> Vec<ValidateCase> { expected: "<warning>Composer could not detect the root package (test/suite) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version</warning>\n<warning>Composer could not detect the root package (test/suite) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version</warning>\n./composer.json is valid", }, ValidateCase { + // WORDING NOTE: upstream asserts justinrainbow's property-prefixed strings + // "- name : The property name is required" / "- description : The property description + // is required". The jsonschema crate reports the same required violations as + // "\"name\" is a required property" (no property prefix; the property name is embedded + // in the message). Matches the divergence already accepted in json_file_test. name: "passing but with warnings", composer_json: publish_data_stripped.clone(), command: vec![], - expected: "./composer.json is valid for simple usage with Composer but has\nstrict errors that make it unable to be published as a package\n<warning>See https://getcomposer.org/doc/04-schema.md for details on the schema</warning>\n# Publish errors\n- name : The property name is required\n- description : The property description is required\n<warning># General warnings</warning>\n- No license specified, it is recommended to do so. For closed-source software you may use \"proprietary\" as license.", + expected: "./composer.json is valid for simple usage with Composer but has\nstrict errors that make it unable to be published as a package\n<warning>See https://getcomposer.org/doc/04-schema.md for details on the schema</warning>\n# Publish errors\n- \"name\" is a required property\n- \"description\" is a required property\n<warning># General warnings</warning>\n- No license specified, it is recommended to do so. For closed-source software you may use \"proprietary\" as license.", }, ValidateCase { name: "passing without publish-check", @@ -88,9 +93,6 @@ fn provide_validate_tests() -> Vec<ValidateCase> { #[test] #[serial] -#[ignore = "validate creates a Composer instance (Factory::create_composer) which panics in \ - PartialComposerHandle::borrow_partial at crates/shirabe/src/composer.rs:446 \ - ('RefCell already mutably borrowed'); source-level borrow conflict, not a test issue"] fn test_validate() { for case in provide_validate_tests() { let _tear_down = init_temp_composer(Some(&case.composer_json), None, None, true); @@ -130,9 +132,6 @@ fn test_validate_on_file_issues() { #[test] #[serial] -#[ignore = "validate with a lock file creates a Composer instance (Factory::create_composer) which \ - panics in PartialComposerHandle::borrow_partial at crates/shirabe/src/composer.rs:446 \ - ('RefCell already mutably borrowed'); source-level borrow conflict, not a test issue"] fn test_with_composer_lock() { let tear_down = init_temp_composer(Some(&minimal_valid_configuration()), None, None, true); create_composer_lock(&[], &[]); |
