From 8117e5450693d19726da877bce8aacf5c7aa53af Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 25 Jun 2026 15:12:06 +0900 Subject: test: port 44 vcs/downloader/version tests using mock infra Port git, version_guesser, gitlab_driver, github_driver, and git_downloader tests using the ProcessExecutor/HttpDownloader mocks and IO/Config stubs. Fix production regex-porting bugs surfaced by the now-reachable paths: Url::sanitize and Response::find_header_value had non-delimited PCRE patterns; implement array_search_mixed non-strict branch and a datetime format mapping. Add HttpDownloader::__new_mock so mocked downloaders skip curl construction. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/util/http/response.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/shirabe/src/util/http') diff --git a/crates/shirabe/src/util/http/response.rs b/crates/shirabe/src/util/http/response.rs index e1da15d..8b7bd34 100644 --- a/crates/shirabe/src/util/http/response.rs +++ b/crates/shirabe/src/util/http/response.rs @@ -63,7 +63,7 @@ impl Response { pub fn find_header_value(headers: &[String], name: &str) -> Option { let mut value = None; - let pattern = format!("(?i)^{}:\\s*(.+?)\\s*$", preg_quote(name, None)); + let pattern = format!("{{^{}:\\s*(.+?)\\s*$}}i", preg_quote(name, None)); for header in headers { let mut matches: indexmap::IndexMap< shirabe_external_packages::composer::pcre::CaptureKey, -- cgit v1.3.1