MCPcopy Create free account
hub / github.com/clawshell/clawshell / test_parse_headers

Function test_parse_headers

src/email.rs:1097–1110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1095
1096 #[test]
1097 fn test_parse_headers() {
1098 let literal = b"From: Alice <alice@example.com>\r\nSubject: Hello\r\nDate: Wed, 1 Jan 2025 00:00:00 +0000\r\n\r\n";
1099 let headers = super::parse_headers(literal);
1100
1101 assert_eq!(
1102 headers.get("from"),
1103 Some(&"Alice <alice@example.com>".to_string())
1104 );
1105 assert_eq!(headers.get("subject"), Some(&"Hello".to_string()));
1106 assert_eq!(
1107 headers.get("date"),
1108 Some(&"Wed, 1 Jan 2025 00:00:00 +0000".to_string())
1109 );
1110 }
1111
1112 #[test]
1113 fn test_extract_text_and_html_bodies_multipart() {

Callers

nothing calls this directly

Calls 1

parse_headersFunction · 0.85

Tested by

no test coverage detected