diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-02 17:32:43 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-02 17:32:43 +0900 |
| commit | 7e31bab9ff7209c9b6d7928a581d7a449846f42e (patch) | |
| tree | b121966a169ee74afe04d066576e862a6702bbf6 /crates/shirabe/tests/repository/vcs | |
| parent | ebcb4a7f013c0511dd6617686395cef17822d1e2 (diff) | |
| download | php-shirabe-7e31bab9ff7209c9b6d7928a581d7a449846f42e.tar.gz php-shirabe-7e31bab9ff7209c9b6d7928a581d7a449846f42e.tar.zst php-shirabe-7e31bab9ff7209c9b6d7928a581d7a449846f42e.zip | |
fix(json): propagate JsonFile::encode errors instead of unwrapping
PHP's JsonFile::encode throws a RuntimeException when json_encode fails; the
port swallowed that into an .unwrap() marked TODO(phase-c). Return
anyhow::Result from encode/encode_with_options and propagate at every call
site (print_table and list_repositories become Result-returning to carry it).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/repository/vcs')
| -rw-r--r-- | crates/shirabe/tests/repository/vcs/forgejo_driver_test.rs | 7 | ||||
| -rw-r--r-- | crates/shirabe/tests/repository/vcs/gitlab_driver_test.rs | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/crates/shirabe/tests/repository/vcs/forgejo_driver_test.rs b/crates/shirabe/tests/repository/vcs/forgejo_driver_test.rs index d9138b0c..46d3832d 100644 --- a/crates/shirabe/tests/repository/vcs/forgejo_driver_test.rs +++ b/crates/shirabe/tests/repository/vcs/forgejo_driver_test.rs @@ -123,6 +123,7 @@ fn repo_body() -> String { ); m })) + .unwrap() } #[test] @@ -175,7 +176,8 @@ fn test_get_branches() { entry.insert("name".to_string(), PhpMixed::String("main".to_string())); entry.insert("commit".to_string(), PhpMixed::Array(commit)); entry - })])); + })])) + .unwrap(); let (http_downloader, _http_guard) = http_mock(vec![ expect_full( @@ -217,7 +219,8 @@ fn test_get_tags() { entry.insert("name".to_string(), PhpMixed::String("1.0".to_string())); entry.insert("commit".to_string(), PhpMixed::Array(commit)); entry - })])); + })])) + .unwrap(); let (http_downloader, _http_guard) = http_mock(vec