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) --- .../tests/command/base_dependency_command_test.rs | 54 +++++-- crates/shirabe/tests/command/bump_command_test.rs | 26 ++-- .../shirabe/tests/command/config_command_test.rs | 40 +++-- .../tests/command/dump_autoload_command_test.rs | 93 ++++++++--- .../shirabe/tests/command/global_command_test.rs | 83 +++++++--- crates/shirabe/tests/command/init_command_test.rs | 137 +++++++++++++---- .../shirabe/tests/command/install_command_test.rs | 33 ++-- .../shirabe/tests/command/licenses_command_test.rs | 83 +++++++--- .../shirabe/tests/command/remove_command_test.rs | 121 +++++++++++---- .../tests/command/repository_command_test.rs | 121 +++++++++++---- .../shirabe/tests/command/require_command_test.rs | 33 ++-- .../tests/command/run_script_command_test.rs | 40 +++-- crates/shirabe/tests/command/show_command_test.rs | 170 +++++++++++++++++---- .../shirabe/tests/command/suggests_command_test.rs | 19 ++- .../shirabe/tests/command/update_command_test.rs | 54 +++++-- 15 files changed, 833 insertions(+), 274 deletions(-) (limited to 'crates/shirabe/tests/command') diff --git a/crates/shirabe/tests/command/base_dependency_command_test.rs b/crates/shirabe/tests/command/base_dependency_command_test.rs index c8ea33a..74a8adf 100644 --- a/crates/shirabe/tests/command/base_dependency_command_test.rs +++ b/crates/shirabe/tests/command/base_dependency_command_test.rs @@ -1,19 +1,43 @@ //! ref: composer/tests/Composer/Test/Command/BaseDependencyCommandTest.php -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] - fn $name() { - todo!() - } - }; +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_exception_when_no_required_parameters() { + todo!() } -stub!(test_exception_when_no_required_parameters); -stub!(test_exception_when_running_locked_without_lock_file); -stub!(test_exception_when_it_could_not_found_the_package); -stub!(test_exception_when_package_was_not_found_in_project); -stub!(test_warning_when_dependencies_are_not_installed); -stub!(test_why_command_outputs); -stub!(test_why_not_command_outputs); +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_exception_when_running_locked_without_lock_file() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_exception_when_it_could_not_found_the_package() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_exception_when_package_was_not_found_in_project() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_warning_when_dependencies_are_not_installed() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_why_command_outputs() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_why_not_command_outputs() { + todo!() +} diff --git a/crates/shirabe/tests/command/bump_command_test.rs b/crates/shirabe/tests/command/bump_command_test.rs index 70adc30..a96dcc7 100644 --- a/crates/shirabe/tests/command/bump_command_test.rs +++ b/crates/shirabe/tests/command/bump_command_test.rs @@ -1,15 +1,19 @@ //! ref: composer/tests/Composer/Test/Command/BumpCommandTest.php -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] - fn $name() { - todo!() - } - }; +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_bump() { + todo!() } -stub!(test_bump); -stub!(test_bump_fails_on_non_existing_composer_file); -stub!(test_bump_fails_on_write_error_to_composer_file); +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_bump_fails_on_non_existing_composer_file() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_bump_fails_on_write_error_to_composer_file() { + todo!() +} diff --git a/crates/shirabe/tests/command/config_command_test.rs b/crates/shirabe/tests/command/config_command_test.rs index b0e1b97..63bcac7 100644 --- a/crates/shirabe/tests/command/config_command_test.rs +++ b/crates/shirabe/tests/command/config_command_test.rs @@ -1,17 +1,31 @@ //! ref: composer/tests/Composer/Test/Command/ConfigCommandTest.php -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] - fn $name() { - todo!() - } - }; +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_config_updates() { + todo!() } -stub!(test_config_updates); -stub!(test_config_reads); -stub!(test_config_throws_for_invalid_arg_combination); -stub!(test_config_throws_for_invalid_severity); -stub!(test_config_throws_when_merging_array_with_object); +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_config_reads() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_config_throws_for_invalid_arg_combination() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_config_throws_for_invalid_severity() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_config_throws_when_merging_array_with_object() { + todo!() +} diff --git a/crates/shirabe/tests/command/dump_autoload_command_test.rs b/crates/shirabe/tests/command/dump_autoload_command_test.rs index 566dc0c..db27ebb 100644 --- a/crates/shirabe/tests/command/dump_autoload_command_test.rs +++ b/crates/shirabe/tests/command/dump_autoload_command_test.rs @@ -1,24 +1,73 @@ //! ref: composer/tests/Composer/Test/Command/DumpAutoloadCommandTest.php -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] - fn $name() { - todo!() - } - }; -} - -stub!(test_dump_autoload); -stub!(test_dump_dev_autoload); -stub!(test_dump_no_dev_autoload); -stub!(test_using_optimize_and_strict_psr); -stub!(test_fails_using_strict_psr_if_class_map_violations_are_found); -stub!(test_using_classmap_authoritative); -stub!(test_using_classmap_authoritative_and_strict_psr); -stub!(test_strict_psr_does_not_work_without_optimized_autoloader); -stub!(test_dev_and_no_dev_cannot_be_combined); -stub!(test_with_custom_autoloader_suffix); -stub!(test_with_existing_composer_lock_and_autoloader_suffix); -stub!(test_with_existing_composer_lock_without_autoloader_suffix); +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_dump_autoload() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_dump_dev_autoload() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_dump_no_dev_autoload() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_using_optimize_and_strict_psr() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_fails_using_strict_psr_if_class_map_violations_are_found() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_using_classmap_authoritative() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_using_classmap_authoritative_and_strict_psr() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_strict_psr_does_not_work_without_optimized_autoloader() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_dev_and_no_dev_cannot_be_combined() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_with_custom_autoloader_suffix() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_with_existing_composer_lock_and_autoloader_suffix() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_with_existing_composer_lock_without_autoloader_suffix() { + todo!() +} diff --git a/crates/shirabe/tests/command/global_command_test.rs b/crates/shirabe/tests/command/global_command_test.rs index 7877b3c..10ddf6c 100644 --- a/crates/shirabe/tests/command/global_command_test.rs +++ b/crates/shirabe/tests/command/global_command_test.rs @@ -15,23 +15,66 @@ impl Drop for TearDown { } } -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] - fn $name() { - let _tear_down = TearDown; - - todo!() - } - }; -} - -stub!(test_global); -stub!(test_cannot_create_home); -stub!(test_global_show); -stub!(test_global_show_without_packages); -stub!(test_global_require); -stub!(test_global_update); -stub!(test_global_changes_directory); -stub!(test_global_missing_command_name); +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_global() { + let _tear_down = TearDown; + + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_cannot_create_home() { + let _tear_down = TearDown; + + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_global_show() { + let _tear_down = TearDown; + + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_global_show_without_packages() { + let _tear_down = TearDown; + + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_global_require() { + let _tear_down = TearDown; + + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_global_update() { + let _tear_down = TearDown; + + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_global_changes_directory() { + let _tear_down = TearDown; + + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_global_missing_command_name() { + let _tear_down = TearDown; + + todo!() +} diff --git a/crates/shirabe/tests/command/init_command_test.rs b/crates/shirabe/tests/command/init_command_test.rs index e7cda3e..043011d 100644 --- a/crates/shirabe/tests/command/init_command_test.rs +++ b/crates/shirabe/tests/command/init_command_test.rs @@ -10,29 +10,114 @@ fn set_up() { server_set("COMPOSER_DEFAULT_EMAIL", "john@example.com".to_string()); } -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] - fn $name() { - set_up(); - - todo!() - } - }; -} - -stub!(test_parse_valid_author_string); -stub!(test_parse_empty_author_string); -stub!(test_parse_author_string_with_invalid_email); -stub!(test_namespace_from_valid_package_name); -stub!(test_namespace_from_invalid_package_name); -stub!(test_namespace_from_missing_package_name); -stub!(test_run_command); -stub!(test_run_command_invalid); -stub!(test_run_guess_name_from_dir_sanitizes_dir); -stub!(test_interactive_run); -stub!(test_format_authors); -stub!(test_get_git_config); -stub!(test_add_vendor_ignore); -stub!(test_has_vendor_ignore); +#[test] +#[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] +fn test_parse_valid_author_string() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] +fn test_parse_empty_author_string() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] +fn test_parse_author_string_with_invalid_email() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] +fn test_namespace_from_valid_package_name() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] +fn test_namespace_from_invalid_package_name() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] +fn test_namespace_from_missing_package_name() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] +fn test_run_command() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] +fn test_run_command_invalid() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] +fn test_run_guess_name_from_dir_sanitizes_dir() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] +fn test_interactive_run() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] +fn test_format_authors() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] +fn test_get_git_config() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] +fn test_add_vendor_ignore() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "needs the ApplicationTester harness or reflection into protected InitCommand helpers"] +fn test_has_vendor_ignore() { + set_up(); + + todo!() +} diff --git a/crates/shirabe/tests/command/install_command_test.rs b/crates/shirabe/tests/command/install_command_test.rs index 9bb5635..1774721 100644 --- a/crates/shirabe/tests/command/install_command_test.rs +++ b/crates/shirabe/tests/command/install_command_test.rs @@ -1,16 +1,25 @@ //! ref: composer/tests/Composer/Test/Command/InstallCommandTest.php -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] - fn $name() { - todo!() - } - }; +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_install_command_errors() { + todo!() } -stub!(test_install_command_errors); -stub!(test_install_from_empty_vendor); -stub!(test_install_from_empty_vendor_no_dev); -stub!(test_install_new_packages_with_existing_partial_vendor); +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_install_from_empty_vendor() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_install_from_empty_vendor_no_dev() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_install_new_packages_with_existing_partial_vendor() { + todo!() +} diff --git a/crates/shirabe/tests/command/licenses_command_test.rs b/crates/shirabe/tests/command/licenses_command_test.rs index 26a7520..113a77e 100644 --- a/crates/shirabe/tests/command/licenses_command_test.rs +++ b/crates/shirabe/tests/command/licenses_command_test.rs @@ -6,23 +6,66 @@ fn set_up() { todo!() } -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] - fn $name() { - set_up(); - - todo!() - } - }; -} - -stub!(test_basic_run); -stub!(test_no_dev); -stub!(test_format_json); -stub!(test_format_summary); -stub!(test_format_unknown); -stub!(test_locked); -stub!(test_locked_no_dev); -stub!(test_locked_without_lock_file); +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_basic_run() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_no_dev() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_format_json() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_format_summary() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_format_unknown() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_locked() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_locked_no_dev() { + set_up(); + + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_locked_without_lock_file() { + set_up(); + + todo!() +} diff --git a/crates/shirabe/tests/command/remove_command_test.rs b/crates/shirabe/tests/command/remove_command_test.rs index 4e3497a..297d136 100644 --- a/crates/shirabe/tests/command/remove_command_test.rs +++ b/crates/shirabe/tests/command/remove_command_test.rs @@ -1,28 +1,97 @@ //! ref: composer/tests/Composer/Test/Command/RemoveCommandTest.php -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] - fn $name() { - todo!() - } - }; -} - -stub!(test_exception_running_with_no_remove_packages); -stub!(test_exception_when_running_unused_without_lock_file); -stub!(test_warning_when_removing_non_existent_package); -stub!(test_warning_when_removing_package_from_wrong_type); -stub!(test_warning_when_removing_package_with_deprecated_dependencies_flag); -stub!(test_message_output_when_no_unused_packages_to_remove); -stub!(test_remove_unused_package); -stub!(test_remove_package_by_name); -stub!(test_remove_package_by_name_with_dry_run); -stub!(test_remove_allowed_plugin_package_with_no_other_allowed_plugins); -stub!(test_remove_allowed_plugin_package_with_other_allowed_plugins); -stub!(test_remove_packages_by_vendor); -stub!(test_remove_packages_by_vendor_with_dry_run); -stub!(test_warning_when_removing_packages_by_vendor_from_wrong_type); -stub!(test_package_still_present_error_when_no_install_flag_used); -stub!(test_update_inherited_dependencies_flag_is_passed_to_post_remove_installer); +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_exception_running_with_no_remove_packages() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_exception_when_running_unused_without_lock_file() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_warning_when_removing_non_existent_package() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_warning_when_removing_package_from_wrong_type() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_warning_when_removing_package_with_deprecated_dependencies_flag() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_message_output_when_no_unused_packages_to_remove() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_remove_unused_package() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_remove_package_by_name() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_remove_package_by_name_with_dry_run() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_remove_allowed_plugin_package_with_no_other_allowed_plugins() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_remove_allowed_plugin_package_with_other_allowed_plugins() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_remove_packages_by_vendor() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_remove_packages_by_vendor_with_dry_run() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_warning_when_removing_packages_by_vendor_from_wrong_type() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_package_still_present_error_when_no_install_flag_used() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_update_inherited_dependencies_flag_is_passed_to_post_remove_installer() { + todo!() +} diff --git a/crates/shirabe/tests/command/repository_command_test.rs b/crates/shirabe/tests/command/repository_command_test.rs index 7611785..33a4451 100644 --- a/crates/shirabe/tests/command/repository_command_test.rs +++ b/crates/shirabe/tests/command/repository_command_test.rs @@ -1,28 +1,97 @@ //! ref: composer/tests/Composer/Test/Command/RepositoryCommandTest.php -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] - fn $name() { - todo!() - } - }; -} - -stub!(test_list_with_no_repositories); -stub!(test_list_with_repositories_as_list); -stub!(test_list_with_repositories_as_assoc); -stub!(test_add_repository_with_type_and_url); -stub!(test_add_repository_with_json); -stub!(test_remove_repository); -stub!(test_set_and_get_url_in_repository_assoc); -stub!(test_set_and_get_url_in_repository_list); -stub!(test_disable_and_enable_packagist); -stub!(test_invalid_arg_combination_throws); -stub!(test_prepend_repository_by_name_list_to_assoc); -stub!(test_append_repository_by_name_list_to_assoc); -stub!(test_prepend_repository_assoc_with_packagist_disabled); -stub!(test_append_repository_assoc_with_packagist_disabled); -stub!(test_add_before_and_after_by_name); -stub!(test_add_same_name_replaces_existing); +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_list_with_no_repositories() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_list_with_repositories_as_list() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_list_with_repositories_as_assoc() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_add_repository_with_type_and_url() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_add_repository_with_json() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_remove_repository() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_set_and_get_url_in_repository_assoc() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_set_and_get_url_in_repository_list() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_disable_and_enable_packagist() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_invalid_arg_combination_throws() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_prepend_repository_by_name_list_to_assoc() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_append_repository_by_name_list_to_assoc() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_prepend_repository_assoc_with_packagist_disabled() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_append_repository_assoc_with_packagist_disabled() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_add_before_and_after_by_name() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_add_same_name_replaces_existing() { + todo!() +} diff --git a/crates/shirabe/tests/command/require_command_test.rs b/crates/shirabe/tests/command/require_command_test.rs index 452892d..470bbe2 100644 --- a/crates/shirabe/tests/command/require_command_test.rs +++ b/crates/shirabe/tests/command/require_command_test.rs @@ -1,16 +1,25 @@ //! ref: composer/tests/Composer/Test/Command/RequireCommandTest.php -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] - fn $name() { - todo!() - } - }; +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_require_throws_if_none_matches() { + todo!() } -stub!(test_require_throws_if_none_matches); -stub!(test_require_warns_if_resolved_to_feature_branch); -stub!(test_require); -stub!(test_inconsistent_require_keys); +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_require_warns_if_resolved_to_feature_branch() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_require() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_inconsistent_require_keys() { + todo!() +} diff --git a/crates/shirabe/tests/command/run_script_command_test.rs b/crates/shirabe/tests/command/run_script_command_test.rs index 9ec848d..14766d4 100644 --- a/crates/shirabe/tests/command/run_script_command_test.rs +++ b/crates/shirabe/tests/command/run_script_command_test.rs @@ -1,17 +1,31 @@ //! ref: composer/tests/Composer/Test/Command/RunScriptCommandTest.php -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] - fn $name() { - todo!() - } - }; +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_detect_and_pass_dev_mode_to_event_and_to_dispatching() { + todo!() } -stub!(test_detect_and_pass_dev_mode_to_event_and_to_dispatching); -stub!(test_can_list_scripts); -stub!(test_can_define_aliases); -stub!(test_execution_of_simple_symfony_command); -stub!(test_execution_of_symfony_command_with_configuration); +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_can_list_scripts() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_can_define_aliases() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_execution_of_simple_symfony_command() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_execution_of_symfony_command_with_configuration() { + todo!() +} diff --git a/crates/shirabe/tests/command/show_command_test.rs b/crates/shirabe/tests/command/show_command_test.rs index 6c2cf13..b17ce22 100644 --- a/crates/shirabe/tests/command/show_command_test.rs +++ b/crates/shirabe/tests/command/show_command_test.rs @@ -1,35 +1,139 @@ //! ref: composer/tests/Composer/Test/Command/ShowCommandTest.php -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] - fn $name() { - todo!() - } - }; -} - -stub!(test_show); -stub!(test_outdated_filters_according_to_platform_reqs_and_warns); -stub!(test_outdated_filters_according_to_platform_reqs_without_warning_for_higher_versions); -stub!(test_show_direct_with_name_does_not_show_transient_dependencies); -stub!(test_show_direct_with_name_only_shows_direct_dependents); -stub!(test_show_platform_only_shows_platform_packages); -stub!(test_show_platform_works_without_composer_json); -stub!(test_outdated_with_zero_major); -stub!(test_show_all_shows_all_sections); -stub!(test_locked_requires_valid_lock_file); -stub!(test_locked_shows_all_locked); -stub!(test_invalid_option_combinations); -stub!(test_ignored_option_combinations); -stub!(test_self_and_name_only); -stub!(test_self_and_package_combination); -stub!(test_self); -stub!(test_not_installed_error); -stub!(test_no_dev_option); -stub!(test_package_filter); -stub!(test_not_existing_package); -stub!(test_not_existing_package_with_working_dir); -stub!(test_specific_package_and_tree); -stub!(test_name_only_prints_no_trailing_whitespace); +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_show() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_outdated_filters_according_to_platform_reqs_and_warns() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_outdated_filters_according_to_platform_reqs_without_warning_for_higher_versions() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_show_direct_with_name_does_not_show_transient_dependencies() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_show_direct_with_name_only_shows_direct_dependents() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_show_platform_only_shows_platform_packages() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_show_platform_works_without_composer_json() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_outdated_with_zero_major() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_show_all_shows_all_sections() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_locked_requires_valid_lock_file() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_locked_shows_all_locked() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_invalid_option_combinations() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_ignored_option_combinations() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_self_and_name_only() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_self_and_package_combination() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_self() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_not_installed_error() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_no_dev_option() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_package_filter() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_not_existing_package() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_not_existing_package_with_working_dir() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_specific_package_and_tree() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_name_only_prints_no_trailing_whitespace() { + todo!() +} diff --git a/crates/shirabe/tests/command/suggests_command_test.rs b/crates/shirabe/tests/command/suggests_command_test.rs index 21e9ec7..ca4d9a2 100644 --- a/crates/shirabe/tests/command/suggests_command_test.rs +++ b/crates/shirabe/tests/command/suggests_command_test.rs @@ -1,14 +1,13 @@ //! ref: composer/tests/Composer/Test/Command/SuggestsCommandTest.php -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] - fn $name() { - todo!() - } - }; +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_installed_packages_with_no_suggestions() { + todo!() } -stub!(test_installed_packages_with_no_suggestions); -stub!(test_suggest); +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_suggest() { + todo!() +} diff --git a/crates/shirabe/tests/command/update_command_test.rs b/crates/shirabe/tests/command/update_command_test.rs index 35053b0..ceae0eb 100644 --- a/crates/shirabe/tests/command/update_command_test.rs +++ b/crates/shirabe/tests/command/update_command_test.rs @@ -1,19 +1,43 @@ //! ref: composer/tests/Composer/Test/Command/UpdateCommandTest.php -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] - fn $name() { - todo!() - } - }; +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_update() { + todo!() } -stub!(test_update); -stub!(test_update_with_patch_only); -stub!(test_interactive_mode_throws_if_no_package_to_update); -stub!(test_interactive_mode_throws_if_no_package_entered); -stub!(test_interactive_tmp); -stub!(test_no_security_blocking_allows_insecure_packages); -stub!(test_bump_after_update_without_lockfile); +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_update_with_patch_only() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_interactive_mode_throws_if_no_package_to_update() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_interactive_mode_throws_if_no_package_entered() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_interactive_tmp() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_no_security_blocking_allows_insecure_packages() { + todo!() +} + +#[test] +#[ignore = "requires the ApplicationTester/initTempComposer harness, which is not yet ported"] +fn test_bump_after_update_without_lockfile() { + todo!() +} -- cgit v1.3.1