diff options
Diffstat (limited to 'crates/shirabe/tests/package')
7 files changed, 442 insertions, 132 deletions
diff --git a/crates/shirabe/tests/package/archiver/archivable_files_finder_test.rs b/crates/shirabe/tests/package/archiver/archivable_files_finder_test.rs index dcca80a..5454074 100644 --- a/crates/shirabe/tests/package/archiver/archivable_files_finder_test.rs +++ b/crates/shirabe/tests/package/archiver/archivable_files_finder_test.rs @@ -26,16 +26,20 @@ impl Drop for TearDown { // These set up a temp directory tree (including a git repo) and assert the files the finder // selects with manual/git/skip excludes; the git-backed fixture setup is not ported. -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "needs a temp directory tree and git-backed fixtures to drive ArchivableFilesFinder; not ported"] - fn $name() { - todo!() - } - }; +#[test] +#[ignore = "needs a temp directory tree and git-backed fixtures to drive ArchivableFilesFinder; not ported"] +fn test_manual_excludes() { + todo!() +} + +#[test] +#[ignore = "needs a temp directory tree and git-backed fixtures to drive ArchivableFilesFinder; not ported"] +fn test_git_excludes() { + todo!() } -stub!(test_manual_excludes); -stub!(test_git_excludes); -stub!(test_skip_excludes); +#[test] +#[ignore = "needs a temp directory tree and git-backed fixtures to drive ArchivableFilesFinder; not ported"] +fn test_skip_excludes() { + todo!() +} diff --git a/crates/shirabe/tests/package/archiver/archive_manager_test.rs b/crates/shirabe/tests/package/archiver/archive_manager_test.rs index 912512d..b3b61f8 100644 --- a/crates/shirabe/tests/package/archiver/archive_manager_test.rs +++ b/crates/shirabe/tests/package/archiver/archive_manager_test.rs @@ -28,18 +28,32 @@ impl Drop for TearDown { // These drive ArchiveManager end-to-end (building tar archives via PharData, todo!()) and // the filename-derivation helpers over packages; the archiving and fixture setup are not // ported. -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "ArchiveManager builds archives via PharData (todo!()) over fixtures; not ported"] - fn $name() { - todo!() - } - }; +#[test] +#[ignore = "ArchiveManager builds archives via PharData (todo!()) over fixtures; not ported"] +fn test_unknown_format() { + todo!() +} + +#[test] +#[ignore = "ArchiveManager builds archives via PharData (todo!()) over fixtures; not ported"] +fn test_archive_tar() { + todo!() +} + +#[test] +#[ignore = "ArchiveManager builds archives via PharData (todo!()) over fixtures; not ported"] +fn test_archive_custom_file_name() { + todo!() +} + +#[test] +#[ignore = "ArchiveManager builds archives via PharData (todo!()) over fixtures; not ported"] +fn test_get_package_filename_parts() { + todo!() } -stub!(test_unknown_format); -stub!(test_archive_tar); -stub!(test_archive_custom_file_name); -stub!(test_get_package_filename_parts); -stub!(test_get_package_filename); +#[test] +#[ignore = "ArchiveManager builds archives via PharData (todo!()) over fixtures; not ported"] +fn test_get_package_filename() { + todo!() +} diff --git a/crates/shirabe/tests/package/loader/array_loader_test.rs b/crates/shirabe/tests/package/loader/array_loader_test.rs index 79b5d78..2dc4f3e 100644 --- a/crates/shirabe/tests/package/loader/array_loader_test.rs +++ b/crates/shirabe/tests/package/loader/array_loader_test.rs @@ -8,37 +8,163 @@ fn set_up() -> ArrayLoader { // ArrayLoader::load parses version/link constraints through a look-around regex the regex // crate cannot compile. -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] - fn $name() { - let _loader = set_up(); - todo!() - } - }; +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_self_version() { + let _loader = set_up(); + todo!() } -stub!(test_self_version); -stub!(test_type_default); -stub!(test_normalized_version_optimization); -stub!(test_parse_dump_default_load_config); -stub!(test_parse_dump_true_load_config); -stub!(test_parse_dump_false_load_config); -stub!(test_package_with_branch_alias); -stub!(test_package_aliasing_without_branch_alias); -stub!(test_abandoned); -stub!(test_not_abandoned); -stub!(test_plugin_api_version_are_kept_as_declared); -stub!(test_plugin_api_version_does_support_self_version); -stub!(test_parse_links_integer_target); -stub!(test_parse_links_invalid_version); -stub!(test_none_string_version); -stub!(test_none_string_source_dist_reference); -stub!(test_branch_alias_integer_index); -stub!(test_package_links_require); -stub!(test_package_links_require_invalid); -stub!(test_package_links_replace); -stub!(test_package_links_replace_invalid); -stub!(test_support_string_value); -stub!(test_invalid_version); +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_type_default() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_normalized_version_optimization() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_parse_dump_default_load_config() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_parse_dump_true_load_config() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_parse_dump_false_load_config() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_package_with_branch_alias() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_package_aliasing_without_branch_alias() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_abandoned() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_not_abandoned() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_plugin_api_version_are_kept_as_declared() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_plugin_api_version_does_support_self_version() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_parse_links_integer_target() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_parse_links_invalid_version() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_none_string_version() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_none_string_source_dist_reference() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_branch_alias_integer_index() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_package_links_require() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_package_links_require_invalid() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_package_links_replace() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_package_links_replace_invalid() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_support_string_value() { + let _loader = set_up(); + todo!() +} + +#[test] +#[ignore = "ArrayLoader::load parses constraints via a look-around regex the regex crate cannot compile"] +fn test_invalid_version() { + let _loader = set_up(); + todo!() +} diff --git a/crates/shirabe/tests/package/loader/validating_array_loader_test.rs b/crates/shirabe/tests/package/loader/validating_array_loader_test.rs index 6e4425d..9858df1 100644 --- a/crates/shirabe/tests/package/loader/validating_array_loader_test.rs +++ b/crates/shirabe/tests/package/loader/validating_array_loader_test.rs @@ -2,17 +2,26 @@ // ValidatingArrayLoader wraps ArrayLoader, whose constraint parsing uses a look-around // regex the regex crate cannot compile; the success/warning data sets are large. -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "ValidatingArrayLoader -> ArrayLoader parses constraints via a look-around regex the regex crate cannot compile"] - fn $name() { - todo!() - } - }; +#[test] +#[ignore = "ValidatingArrayLoader -> ArrayLoader parses constraints via a look-around regex the regex crate cannot compile"] +fn test_load_success() { + todo!() } -stub!(test_load_success); -stub!(test_load_failure_throws_exception); -stub!(test_load_warnings); -stub!(test_load_skips_warning_data_when_ignoring_errors); +#[test] +#[ignore = "ValidatingArrayLoader -> ArrayLoader parses constraints via a look-around regex the regex crate cannot compile"] +fn test_load_failure_throws_exception() { + todo!() +} + +#[test] +#[ignore = "ValidatingArrayLoader -> ArrayLoader parses constraints via a look-around regex the regex crate cannot compile"] +fn test_load_warnings() { + todo!() +} + +#[test] +#[ignore = "ValidatingArrayLoader -> ArrayLoader parses constraints via a look-around regex the regex crate cannot compile"] +fn test_load_skips_warning_data_when_ignoring_errors() { + todo!() +} diff --git a/crates/shirabe/tests/package/locker_test.rs b/crates/shirabe/tests/package/locker_test.rs index 4023c10..7b5d39f 100644 --- a/crates/shirabe/tests/package/locker_test.rs +++ b/crates/shirabe/tests/package/locker_test.rs @@ -3,23 +3,62 @@ // These construct a Locker with a mocked JsonFile/InstallationManager/repository and a // mocked ProcessExecutor to drive lock read/write and freshness checks; mocking is not // available here. -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "mocks JsonFile/InstallationManager/repository/ProcessExecutor to drive Locker; mocking is not available"] - fn $name() { - todo!() - } - }; +#[test] +#[ignore = "mocks JsonFile/InstallationManager/repository/ProcessExecutor to drive Locker; mocking is not available"] +fn test_is_locked() { + todo!() } -stub!(test_is_locked); -stub!(test_get_not_locked_packages); -stub!(test_get_locked_packages); -stub!(test_set_lock_data); -stub!(test_lock_bad_packages); -stub!(test_is_fresh); -stub!(test_is_fresh_false); -stub!(test_is_fresh_with_content_hash); -stub!(test_is_fresh_with_content_hash_and_no_hash); -stub!(test_is_fresh_false_with_content_hash); +#[test] +#[ignore = "mocks JsonFile/InstallationManager/repository/ProcessExecutor to drive Locker; mocking is not available"] +fn test_get_not_locked_packages() { + todo!() +} + +#[test] +#[ignore = "mocks JsonFile/InstallationManager/repository/ProcessExecutor to drive Locker; mocking is not available"] +fn test_get_locked_packages() { + todo!() +} + +#[test] +#[ignore = "mocks JsonFile/InstallationManager/repository/ProcessExecutor to drive Locker; mocking is not available"] +fn test_set_lock_data() { + todo!() +} + +#[test] +#[ignore = "mocks JsonFile/InstallationManager/repository/ProcessExecutor to drive Locker; mocking is not available"] +fn test_lock_bad_packages() { + todo!() +} + +#[test] +#[ignore = "mocks JsonFile/InstallationManager/repository/ProcessExecutor to drive Locker; mocking is not available"] +fn test_is_fresh() { + todo!() +} + +#[test] +#[ignore = "mocks JsonFile/InstallationManager/repository/ProcessExecutor to drive Locker; mocking is not available"] +fn test_is_fresh_false() { + todo!() +} + +#[test] +#[ignore = "mocks JsonFile/InstallationManager/repository/ProcessExecutor to drive Locker; mocking is not available"] +fn test_is_fresh_with_content_hash() { + todo!() +} + +#[test] +#[ignore = "mocks JsonFile/InstallationManager/repository/ProcessExecutor to drive Locker; mocking is not available"] +fn test_is_fresh_with_content_hash_and_no_hash() { + todo!() +} + +#[test] +#[ignore = "mocks JsonFile/InstallationManager/repository/ProcessExecutor to drive Locker; mocking is not available"] +fn test_is_fresh_false_with_content_hash() { + todo!() +} diff --git a/crates/shirabe/tests/package/version/version_guesser_test.rs b/crates/shirabe/tests/package/version/version_guesser_test.rs index 9b974dd..75d4ae0 100644 --- a/crates/shirabe/tests/package/version/version_guesser_test.rs +++ b/crates/shirabe/tests/package/version/version_guesser_test.rs @@ -23,30 +23,94 @@ impl Drop for TearDown { // These drive VersionGuesser with a mocked ProcessExecutor feeding git/hg command output; // mocking is not available here. -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] - fn $name() { - todo!() - } - }; +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_hg_guess_version_returns_data() { + todo!() +} + +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_guess_version_returns_data() { + todo!() +} + +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_guess_version_does_not_see_custom_default_branch_as_non_feature_branch() { + todo!() +} + +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_guess_version_reads_and_respects_non_feature_branches_configuration_for_arbitrary_naming() { + todo!() +} + +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_guess_version_reads_and_respects_non_feature_branches_configuration_for_arbitrary_naming_regex() + { + todo!() +} + +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_guess_version_reads_and_respects_non_feature_branches_configuration_for_arbitrary_naming_when_on_non_feature_branch() + { + todo!() +} + +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_detached_head_becomes_dev_hash() { + todo!() +} + +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_detached_fetch_head_becomes_dev_hash_git2() { + todo!() +} + +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_detached_commit_head_becomes_dev_hash_git2() { + todo!() } -stub!(test_hg_guess_version_returns_data); -stub!(test_guess_version_returns_data); -stub!(test_guess_version_does_not_see_custom_default_branch_as_non_feature_branch); -stub!( - test_guess_version_reads_and_respects_non_feature_branches_configuration_for_arbitrary_naming -); -stub!(test_guess_version_reads_and_respects_non_feature_branches_configuration_for_arbitrary_naming_regex); -stub!(test_guess_version_reads_and_respects_non_feature_branches_configuration_for_arbitrary_naming_when_on_non_feature_branch); -stub!(test_detached_head_becomes_dev_hash); -stub!(test_detached_fetch_head_becomes_dev_hash_git2); -stub!(test_detached_commit_head_becomes_dev_hash_git2); -stub!(test_tag_becomes_version); -stub!(test_tag_becomes_pretty_version); -stub!(test_invalid_tag_becomes_version); -stub!(test_numeric_branches_show_nicely); -stub!(test_remote_branches_are_selected); -stub!(test_get_root_version_from_env); +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_tag_becomes_version() { + todo!() +} + +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_tag_becomes_pretty_version() { + todo!() +} + +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_invalid_tag_becomes_version() { + todo!() +} + +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_numeric_branches_show_nicely() { + todo!() +} + +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_remote_branches_are_selected() { + todo!() +} + +#[test] +#[ignore = "mocks a ProcessExecutor feeding git/hg output to drive VersionGuesser; mocking is not available"] +fn test_get_root_version_from_env() { + todo!() +} diff --git a/crates/shirabe/tests/package/version/version_selector_test.rs b/crates/shirabe/tests/package/version/version_selector_test.rs index ccd64ad..fd426ce 100644 --- a/crates/shirabe/tests/package/version/version_selector_test.rs +++ b/crates/shirabe/tests/package/version/version_selector_test.rs @@ -2,26 +2,80 @@ // VersionSelector ranks candidate packages whose versions/constraints are parsed through a // look-around regex the regex crate cannot compile; the setup also mocks a repository. -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "not yet ported (VersionSelector over a mocked repository; constraint parsing uses a look-around regex)"] - fn $name() { - todo!() - } - }; +#[test] +#[ignore = "not yet ported (VersionSelector over a mocked repository; constraint parsing uses a look-around regex)"] +fn test_latest_version_is_returned() { + todo!() } -stub!(test_latest_version_is_returned); -stub!(test_latest_version_is_returned_that_matches_php_requirements); -stub!(test_latest_version_is_returned_that_matches_ext_requirements); -stub!(test_latest_version_is_returned_that_matches_platform_ext); -stub!(test_latest_version_is_returned_that_matches_composer_requirements); -stub!(test_most_stable_version_is_returned); -stub!(test_most_stable_version_is_returned_regardless_of_order); -stub!(test_highest_version_is_returned); -stub!(test_highest_version_matching_stability_is_returned); -stub!(test_most_stable_unstable_version_is_returned); -stub!(test_default_branch_alias_is_never_returned); -stub!(test_false_returned_on_no_packages); -stub!(test_find_recommended_require_version); +#[test] +#[ignore = "not yet ported (VersionSelector over a mocked repository; constraint parsing uses a look-around regex)"] +fn test_latest_version_is_returned_that_matches_php_requirements() { + todo!() +} + +#[test] +#[ignore = "not yet ported (VersionSelector over a mocked repository; constraint parsing uses a look-around regex)"] +fn test_latest_version_is_returned_that_matches_ext_requirements() { + todo!() +} + +#[test] +#[ignore = "not yet ported (VersionSelector over a mocked repository; constraint parsing uses a look-around regex)"] +fn test_latest_version_is_returned_that_matches_platform_ext() { + todo!() +} + +#[test] +#[ignore = "not yet ported (VersionSelector over a mocked repository; constraint parsing uses a look-around regex)"] +fn test_latest_version_is_returned_that_matches_composer_requirements() { + todo!() +} + +#[test] +#[ignore = "not yet ported (VersionSelector over a mocked repository; constraint parsing uses a look-around regex)"] +fn test_most_stable_version_is_returned() { + todo!() +} + +#[test] +#[ignore = "not yet ported (VersionSelector over a mocked repository; constraint parsing uses a look-around regex)"] +fn test_most_stable_version_is_returned_regardless_of_order() { + todo!() +} + +#[test] +#[ignore = "not yet ported (VersionSelector over a mocked repository; constraint parsing uses a look-around regex)"] +fn test_highest_version_is_returned() { + todo!() +} + +#[test] +#[ignore = "not yet ported (VersionSelector over a mocked repository; constraint parsing uses a look-around regex)"] +fn test_highest_version_matching_stability_is_returned() { + todo!() +} + +#[test] +#[ignore = "not yet ported (VersionSelector over a mocked repository; constraint parsing uses a look-around regex)"] +fn test_most_stable_unstable_version_is_returned() { + todo!() +} + +#[test] +#[ignore = "not yet ported (VersionSelector over a mocked repository; constraint parsing uses a look-around regex)"] +fn test_default_branch_alias_is_never_returned() { + todo!() +} + +#[test] +#[ignore = "not yet ported (VersionSelector over a mocked repository; constraint parsing uses a look-around regex)"] +fn test_false_returned_on_no_packages() { + todo!() +} + +#[test] +#[ignore = "not yet ported (VersionSelector over a mocked repository; constraint parsing uses a look-around regex)"] +fn test_find_recommended_require_version() { + todo!() +} |
