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/downloader/zip_downloader_test.rs | 88 +++++++++++++++++----- 1 file changed, 69 insertions(+), 19 deletions(-) (limited to 'crates/shirabe/tests/downloader/zip_downloader_test.rs') diff --git a/crates/shirabe/tests/downloader/zip_downloader_test.rs b/crates/shirabe/tests/downloader/zip_downloader_test.rs index aa4646c..c22afa1 100644 --- a/crates/shirabe/tests/downloader/zip_downloader_test.rs +++ b/crates/shirabe/tests/downloader/zip_downloader_test.rs @@ -47,24 +47,74 @@ impl Drop for TearDown { // These construct a ZipDownloader with a mocked IO/HttpDownloader/ProcessExecutor and rely // on ZipArchive extraction (todo!() in the php-shim) plus mocked unzip behaviour. -macro_rules! stub { - ($name:ident) => { - #[test] - #[ignore = "mocks IO/HttpDownloader/ProcessExecutor and uses ZipArchive (todo!())"] - fn $name() { - let set_up = set_up(); - let _tear_down = TearDown::new(set_up.test_dir.path().to_path_buf()); - let _ = (&set_up.test_dir, &set_up.filename); - todo!() - } - }; +#[test] +#[ignore = "mocks IO/HttpDownloader/ProcessExecutor and uses ZipArchive (todo!())"] +fn test_error_messages() { + let set_up = set_up(); + let _tear_down = TearDown::new(set_up.test_dir.path().to_path_buf()); + let _ = (&set_up.test_dir, &set_up.filename); + todo!() +} + +#[test] +#[ignore = "mocks IO/HttpDownloader/ProcessExecutor and uses ZipArchive (todo!())"] +fn test_zip_archive_only_failed() { + let set_up = set_up(); + let _tear_down = TearDown::new(set_up.test_dir.path().to_path_buf()); + let _ = (&set_up.test_dir, &set_up.filename); + todo!() } -stub!(test_error_messages); -stub!(test_zip_archive_only_failed); -stub!(test_zip_archive_extract_only_failed); -stub!(test_zip_archive_only_good); -stub!(test_system_unzip_only_failed); -stub!(test_system_unzip_only_good); -stub!(test_non_windows_fallback_good); -stub!(test_non_windows_fallback_failed); +#[test] +#[ignore = "mocks IO/HttpDownloader/ProcessExecutor and uses ZipArchive (todo!())"] +fn test_zip_archive_extract_only_failed() { + let set_up = set_up(); + let _tear_down = TearDown::new(set_up.test_dir.path().to_path_buf()); + let _ = (&set_up.test_dir, &set_up.filename); + todo!() +} + +#[test] +#[ignore = "mocks IO/HttpDownloader/ProcessExecutor and uses ZipArchive (todo!())"] +fn test_zip_archive_only_good() { + let set_up = set_up(); + let _tear_down = TearDown::new(set_up.test_dir.path().to_path_buf()); + let _ = (&set_up.test_dir, &set_up.filename); + todo!() +} + +#[test] +#[ignore = "mocks IO/HttpDownloader/ProcessExecutor and uses ZipArchive (todo!())"] +fn test_system_unzip_only_failed() { + let set_up = set_up(); + let _tear_down = TearDown::new(set_up.test_dir.path().to_path_buf()); + let _ = (&set_up.test_dir, &set_up.filename); + todo!() +} + +#[test] +#[ignore = "mocks IO/HttpDownloader/ProcessExecutor and uses ZipArchive (todo!())"] +fn test_system_unzip_only_good() { + let set_up = set_up(); + let _tear_down = TearDown::new(set_up.test_dir.path().to_path_buf()); + let _ = (&set_up.test_dir, &set_up.filename); + todo!() +} + +#[test] +#[ignore = "mocks IO/HttpDownloader/ProcessExecutor and uses ZipArchive (todo!())"] +fn test_non_windows_fallback_good() { + let set_up = set_up(); + let _tear_down = TearDown::new(set_up.test_dir.path().to_path_buf()); + let _ = (&set_up.test_dir, &set_up.filename); + todo!() +} + +#[test] +#[ignore = "mocks IO/HttpDownloader/ProcessExecutor and uses ZipArchive (todo!())"] +fn test_non_windows_fallback_failed() { + let set_up = set_up(); + let _tear_down = TearDown::new(set_up.test_dir.path().to_path_buf()); + let _ = (&set_up.test_dir, &set_up.filename); + todo!() +} -- cgit v1.3.1