test multipart
This commit is contained in:
parent
cb7b767271
commit
3e8f374723
1 changed files with 14 additions and 0 deletions
|
@ -328,6 +328,8 @@ pub fn content_type(input: &str) -> IResult<&str, Type> {
|
|||
.into_iter()
|
||||
.partition(|p| matches!(p, Parameter::Boundary(_)));
|
||||
|
||||
println!("{:?} //// {:?}", boundary_param, unknown_parameters);
|
||||
|
||||
// @FIXME: if multiple boundary value is set, only the
|
||||
// first one is picked. We should check that it makes
|
||||
// sense with other implementation.
|
||||
|
@ -460,6 +462,18 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_content_type_multipart() {
|
||||
assert_eq!(
|
||||
Type::try_from(&lazy::Type("multipart/mixed;\r\n\tboundary=\"--==_mimepart_64a3f2c69114f_2a13d020975fe\";\r\n\tcharset=UTF-8")),
|
||||
Ok(Type::Multipart(MultipartDesc {
|
||||
subtype: MultipartSubtype::Mixed,
|
||||
boundary: "--==_mimepart_64a3f2c69114f_2a13d020975fe".into(),
|
||||
unknown_parameters: vec![Parameter::Charset(EmailCharset::UTF_8)],
|
||||
}))
|
||||
);
|
||||
}
|
||||
|
||||
/* #[test]
|
||||
fn test_parameter() {
|
||||
assert_eq!(
|
||||
|
|
Loading…
Reference in a new issue