aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-09-11 06:14:44 +0000
committerFuwn <[email protected]>2025-09-11 06:14:44 +0000
commitf80e2cd059de032153a0e24acd2bb8395992cd22 (patch)
tree637d63c87d5010aab3c0160f64ce320919a68e0c /tests
parentfix(request): Handle invalid URLs (diff)
downloadgerm-f80e2cd059de032153a0e24acd2bb8395992cd22.tar.xz
germ-f80e2cd059de032153a0e24acd2bb8395992cd22.zip
fix(meta): Better comply with RFC 2045
Diffstat (limited to 'tests')
-rw-r--r--tests/meta.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/meta.rs b/tests/meta.rs
index e92df0e..368cd68 100644
--- a/tests/meta.rs
+++ b/tests/meta.rs
@@ -90,4 +90,16 @@ mod test {
2,
);
}
+
+ #[test]
+ fn meta_handles_malformed_parameters() {
+ let meta =
+ Meta::from_string("text/gemini; valid=value; malformed; another=test");
+
+ assert_eq!(meta.mime(), "text/gemini");
+ assert_eq!(meta.parameters().len(), 2);
+ assert_eq!(meta.parameters().get("valid"), Some(&"value".to_string()));
+ assert_eq!(meta.parameters().get("another"), Some(&"test".to_string()));
+ assert_eq!(meta.parameters().get("malformed"), None);
+ }
}