From 3a883e6912e642a1bcfe68336007eae018207308 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 25 Jun 2026 15:37:21 +0900 Subject: test: port 35 auth/installer/io/zip/bitbucket tests; implement date_create Port auth_helper (14), library_installer (8), console_io (7), zip_downloader (3), git_bitbucket_driver (3) tests. Implement date_create/strtotime for the ISO8601/ RFC3339/relative formats Composer uses (unknown input -> None, no silent guess). Fix production bugs: Question::is_assoc list-vs-assoc, auth_helper gitlab-domains list handling, LibraryInstaller RefCell double-borrow, ZipArchive::extract_to ErrorException propagation. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/downloader/zip_downloader.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'crates/shirabe/src/downloader') diff --git a/crates/shirabe/src/downloader/zip_downloader.rs b/crates/shirabe/src/downloader/zip_downloader.rs index bea2b20..80ce6f9 100644 --- a/crates/shirabe/src/downloader/zip_downloader.rs +++ b/crates/shirabe/src/downloader/zip_downloader.rs @@ -332,7 +332,7 @@ impl ZipDownloader { } } - let extract_result = zip_archive.extract_to(path); + let extract_result = zip_archive.extract_to(path)?; if extract_result { zip_archive.close(); @@ -393,6 +393,28 @@ impl ZipDownloader { ), } } + + /// For testing only. Mirrors the test's `setPrivateProperty('hasZipArchive', ...)` reflection on + /// the `ZipDownloader::$hasZipArchive` static. + pub fn __set_has_zip_archive(value: Option) { + *HAS_ZIP_ARCHIVE.lock().unwrap() = value; + } + + /// For testing only. Mirrors the test's `setPrivateProperty('isWindows', ...)` reflection. + pub fn __set_is_windows(value: Option) { + *IS_WINDOWS.lock().unwrap() = value; + } + + /// For testing only. Mirrors the test's `setPrivateProperty('unzipCommands', ...)` reflection. + pub fn __set_unzip_commands(value: Option>>) { + *UNZIP_COMMANDS.lock().unwrap() = value; + } + + /// For testing only. Mirrors the test's `setPrivateProperty('zipArchiveObject', $zipArchive, $obj)` + /// reflection on the instance's `$zipArchiveObject` property. + pub fn __set_zip_archive_object(&mut self, value: Option) { + self.zip_archive_object = value; + } } impl ArchiveDownloader for ZipDownloader { -- cgit v1.3.1