diff options
| author | Fuwn <[email protected]> | 2025-09-11 06:04:01 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-09-11 06:04:01 +0000 |
| commit | 51e79294d8fbfb1bd4be8584e2d32ff0712227aa (patch) | |
| tree | e77c766264366af78345c2e1da823e6610c852a6 /tests | |
| parent | fix(request): Handle malformed response header (diff) | |
| download | germ-51e79294d8fbfb1bd4be8584e2d32ff0712227aa.tar.xz germ-51e79294d8fbfb1bd4be8584e2d32ff0712227aa.zip | |
fix(request): Handle invalid URLs
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/status.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/status.rs b/tests/status.rs index 6a210a0..cc46ef6 100644 --- a/tests/status.rs +++ b/tests/status.rs @@ -29,4 +29,16 @@ mod test { fn i32_from_status() { assert_eq!(i32::from(Status::Input), 10); } + + #[cfg(feature = "blocking")] + #[test] + fn invalid_url_handling() { + use url::Url; + + let invalid_url = Url::parse("gemini://").unwrap(); + let result = germ::request::blocking::request(&invalid_url); + + assert!(result.is_err()); + assert!(result.unwrap_err().to_string().contains("missing domain")); + } } |