From d02e79c0cddd986a0b2cef878f32bda39cc2f5e9 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 21 Jun 2026 04:30:31 +0900 Subject: test: port SecurityAdvisoryPoolFilter, downloader/command/app stubs All ignored/todo!(): the advisory filter parses affectedVersions via a look-around regex; the Hg/Fossil/Perforce/Archive downloaders and RepositoryManager need mocked process/HttpDownloader (curl); the Validate/ Archive commands, ApplicationTest and CompletionFunctionalTest need the ApplicationTester/console harness. setUp/tearDown not ported. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/tests/dependency_resolver/main.rs | 1 + .../shirabe/tests/dependency_resolver/rule_test.rs | 10 +++++--- .../security_advisory_pool_filter_test.rs | 29 ++++++++++++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) (limited to 'crates/shirabe/tests/dependency_resolver') diff --git a/crates/shirabe/tests/dependency_resolver/main.rs b/crates/shirabe/tests/dependency_resolver/main.rs index a647604..80e587a 100644 --- a/crates/shirabe/tests/dependency_resolver/main.rs +++ b/crates/shirabe/tests/dependency_resolver/main.rs @@ -5,5 +5,6 @@ mod pool_test; mod request_test; mod rule_set_iterator_test; mod rule_set_test; +mod security_advisory_pool_filter_test; mod rule_test; mod transaction_test; diff --git a/crates/shirabe/tests/dependency_resolver/rule_test.rs b/crates/shirabe/tests/dependency_resolver/rule_test.rs index 31c525f..9806820 100644 --- a/crates/shirabe/tests/dependency_resolver/rule_test.rs +++ b/crates/shirabe/tests/dependency_resolver/rule_test.rs @@ -1,8 +1,6 @@ //! ref: composer/tests/Composer/Test/DependencyResolver/RuleTest.php -use shirabe::dependency_resolver::{ - GenericRule, RULE_ROOT_REQUIRE, ReasonData, Rule, RuleSet, -}; +use shirabe::dependency_resolver::{GenericRule, RULE_ROOT_REQUIRE, ReasonData, Rule, RuleSet}; use shirabe_semver::constraint::MatchAllConstraint; fn root_require_reason() -> ReasonData { @@ -13,7 +11,11 @@ fn root_require_reason() -> ReasonData { } fn generic_rule(literals: Vec) -> Rule { - Rule::Generic(GenericRule::new(literals, RULE_ROOT_REQUIRE, root_require_reason())) + Rule::Generic(GenericRule::new( + literals, + RULE_ROOT_REQUIRE, + root_require_reason(), + )) } #[test] diff --git a/crates/shirabe/tests/dependency_resolver/security_advisory_pool_filter_test.rs b/crates/shirabe/tests/dependency_resolver/security_advisory_pool_filter_test.rs index d002fd8..825d6b4 100644 --- a/crates/shirabe/tests/dependency_resolver/security_advisory_pool_filter_test.rs +++ b/crates/shirabe/tests/dependency_resolver/security_advisory_pool_filter_test.rs @@ -1 +1,30 @@ //! ref: composer/tests/Composer/Test/DependencyResolver/SecurityAdvisoryPoolFilterTest.php + +// The filter parses each advisory's affectedVersions (e.g. ">=1.0.0,<1.1.0") into a +// constraint, which goes through the version parser's look-around regex that the regex +// crate cannot compile. The fixtures also build PackageRepository security-advisory data +// and run the Auditor. + +#[test] +#[ignore = "filtering parses affectedVersions via a look-around regex the regex crate cannot compile"] +fn test_filter_packages_by_advisories() { + todo!() +} + +#[test] +#[ignore = "filtering parses affectedVersions via a look-around regex the regex crate cannot compile"] +fn test_dont_filter_packages_by_ignored_advisories() { + todo!() +} + +#[test] +#[ignore = "filtering parses affectedVersions via a look-around regex the regex crate cannot compile"] +fn test_dont_filter_packages_with_block_insecure_disabled() { + todo!() +} + +#[test] +#[ignore = "filtering parses affectedVersions via a look-around regex the regex crate cannot compile"] +fn test_dont_filter_packages_with_abandoned_package() { + todo!() +} -- cgit v1.3.1