From f0f5f084c883dc4f5b6e61603e82cd1c2092fd9d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 21 Jun 2026 13:11:49 +0900 Subject: test(tests): expand stub macros into plain test functions The per-file stub!/encode_stub!/etc. macros generated #[ignore]d test functions but obscured the individual test bodies. Expanding them inline removes the macro indirection so future ports can fill in each function directly. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../event_dispatcher/event_dispatcher_test.rs | 130 ++++++++++++++++----- 1 file changed, 104 insertions(+), 26 deletions(-) (limited to 'crates/shirabe/tests/event_dispatcher') diff --git a/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs b/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs index 3d9ee0a..8e979a0 100644 --- a/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs +++ b/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs @@ -17,29 +17,107 @@ impl Drop for TearDown { // These build an EventDispatcher with a mocked Composer/IO/ProcessExecutor and run script // listeners (executing CLI/PHP callbacks); mocking and the script-execution machinery are // not available here. -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] - fn $name() { - let _tear_down = TearDown; - todo!() - } - }; -} - -stub!(test_listener_exceptions_are_caught); -stub!(test_dispatcher_can_execute_single_command_line_script); -stub!(test_dispatcher_pass_dev_mode_to_autoload_generator_for_script_events); -stub!(test_dispatcher_remove_listener); -stub!(test_dispatcher_can_execute_cli_and_php_in_same_event_script_stack); -stub!(test_dispatcher_can_put_env); -stub!(test_dispatcher_appends_dir_bin_on_path_for_every_listener); -stub!(test_dispatcher_support_for_additional_args); -stub!(test_dispatcher_can_execute_composer_script_groups); -stub!(test_recursion_in_scripts_names); -stub!(test_dispatcher_detect_infinite_recursion); -stub!(test_dispatcher_outputs_command); -stub!(test_dispatcher_outputs_error_on_failed_command); -stub!(test_dispatcher_installer_events); -stub!(test_dispatcher_doesnt_return_skipped_scripts); +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_listener_exceptions_are_caught() { + let _tear_down = TearDown; + todo!() +} + +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_dispatcher_can_execute_single_command_line_script() { + let _tear_down = TearDown; + todo!() +} + +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_dispatcher_pass_dev_mode_to_autoload_generator_for_script_events() { + let _tear_down = TearDown; + todo!() +} + +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_dispatcher_remove_listener() { + let _tear_down = TearDown; + todo!() +} + +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_dispatcher_can_execute_cli_and_php_in_same_event_script_stack() { + let _tear_down = TearDown; + todo!() +} + +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_dispatcher_can_put_env() { + let _tear_down = TearDown; + todo!() +} + +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_dispatcher_appends_dir_bin_on_path_for_every_listener() { + let _tear_down = TearDown; + todo!() +} + +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_dispatcher_support_for_additional_args() { + let _tear_down = TearDown; + todo!() +} + +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_dispatcher_can_execute_composer_script_groups() { + let _tear_down = TearDown; + todo!() +} + +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_recursion_in_scripts_names() { + let _tear_down = TearDown; + todo!() +} + +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_dispatcher_detect_infinite_recursion() { + let _tear_down = TearDown; + todo!() +} + +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_dispatcher_outputs_command() { + let _tear_down = TearDown; + todo!() +} + +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_dispatcher_outputs_error_on_failed_command() { + let _tear_down = TearDown; + todo!() +} + +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_dispatcher_installer_events() { + let _tear_down = TearDown; + todo!() +} + +#[test] +#[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] +fn test_dispatcher_doesnt_return_skipped_scripts() { + let _tear_down = TearDown; + todo!() +} -- cgit v1.3.1