From 4d9e3dd6176a0cd2cc5e158b044beeb7b3de21be Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 12 Jul 2026 01:28:17 +0900 Subject: test(util): port remaining todo!() tests in util test suite Implement previously-todo!() tests in auth_helper_test.rs, process_executor_test.rs, remote_filesystem_test.rs, and stream_context_factory_test.rs by porting the corresponding PHPUnit test methods. Extend IOStub with writeRaw/setAuthentication call tracking and askAndValidate/getAuthentication overrides to model the PHPUnit mocks these tests rely on, deduping the resulting call-recording fields into a small generic CallRecorder helper instead of repeating the same RefCell> push/borrow().clone() boilerplate five times. testStoreAuthWithPromptInvalidAnswer and testPromptAuthIfNeededMultipleBitbucketDownloads had initially lost the ported PHPUnit mock's argument/call-count assertions (askAndValidate's exact prompt string, and hasAuthentication/getAuthentication's exactly(2) call counts), silently narrowing what the tests verify; IOStub now records these calls and the tests assert on them, matching upstream. Tests left unportable (PHP set_error_handler machinery, closures in data providers, network/subclass-mock dependencies, etc.) keep #[ignore] with a single // TODO(phase-d) reason recorded in the function body. Co-Authored-By: Claude Sonnet 5 --- crates/shirabe/tests/util/error_handler_test.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'crates/shirabe/tests/util/error_handler_test.rs') diff --git a/crates/shirabe/tests/util/error_handler_test.rs b/crates/shirabe/tests/util/error_handler_test.rs index 7295cf2a..ed5e6a29 100644 --- a/crates/shirabe/tests/util/error_handler_test.rs +++ b/crates/shirabe/tests/util/error_handler_test.rs @@ -5,15 +5,15 @@ // trigger those by undefined-index access / array_merge misuse. There is no equivalent // runtime mechanism in Rust to port faithfully. +// TODO(phase-d): ErrorHandler::register() installs a PHP set_error_handler; no Rust equivalent. #[allow(dead_code)] fn set_up() { - // ErrorHandler::register() installs a PHP set_error_handler; no Rust equivalent. todo!() } +// TODO(phase-d): restore_error_handler() is PHP runtime machinery; no Rust equivalent. #[allow(dead_code)] fn tear_down() { - // restore_error_handler() is PHP runtime machinery; no Rust equivalent. todo!() } @@ -29,17 +29,24 @@ impl Drop for TearDown { #[ignore = "depends on PHP runtime routing an undefined-index notice through set_error_handler; no Rust equivalent for $array['baz'] triggering ErrorHandler::handle"] #[test] fn test_error_handler_capture_notice() { + // TODO(phase-d): depends on PHP runtime routing an undefined-index notice through + // set_error_handler; no Rust equivalent for $array['baz'] triggering + // ErrorHandler::handle. todo!() } #[ignore = "depends on PHP runtime emitting a TypeError/warning from array_merge([], 'string') via set_error_handler; no Rust equivalent"] #[test] fn test_error_handler_capture_warning() { + // TODO(phase-d): depends on PHP runtime emitting a TypeError/warning from + // array_merge([], 'string') via set_error_handler; no Rust equivalent. todo!() } #[ignore = "depends on the PHP @ error-suppression operator and trigger_error routing through set_error_handler; no Rust equivalent"] #[test] fn test_error_handler_respects_at_operator() { + // TODO(phase-d): depends on the PHP @ error-suppression operator and trigger_error + // routing through set_error_handler; no Rust equivalent. todo!() } -- cgit v1.3.1