test(headers): Add tests for possibly empty list headers.
This commit is contained in:
		| @@ -125,7 +125,7 @@ macro_rules! header { | ||||
|     // $nn:expr: Nice name of the header | ||||
|  | ||||
|     // List header, zero or more items | ||||
|     ($(#[$a:meta])*($id:ident, $n:expr) => ($item:ty)*) => { | ||||
|     ($(#[$a:meta])*($id:ident, $n:expr) => ($item:ty)* $tm:ident{$($tf:item)*}) => { | ||||
|         $(#[$a])* | ||||
|         #[derive(Clone, Debug, PartialEq)] | ||||
|         pub struct $id(pub Vec<$item>); | ||||
| @@ -149,6 +149,14 @@ macro_rules! header { | ||||
|                 self.fmt_header(f) | ||||
|             } | ||||
|         } | ||||
|         #[allow(unused_imports)] | ||||
|         mod $tm{ | ||||
|             use $crate::header::*; | ||||
|             use $crate::mime::*; | ||||
|             use $crate::method::Method; | ||||
|             use super::$id as HeaderField; | ||||
|             $($tf)* | ||||
|         } | ||||
|  | ||||
|     }; | ||||
|     // List header, one or more items | ||||
| @@ -180,6 +188,7 @@ macro_rules! header { | ||||
|         mod $tm{ | ||||
|             use $crate::header::*; | ||||
|             use $crate::mime::*; | ||||
|             use $crate::method::Method; | ||||
|             use super::$id as HeaderField; | ||||
|             $($tf)* | ||||
|         } | ||||
| @@ -253,6 +262,7 @@ macro_rules! header { | ||||
|         mod $tm{ | ||||
|             use $crate::header::*; | ||||
|             use $crate::mime::*; | ||||
|             use $crate::method::Method; | ||||
|             use super::$id as HeaderField; | ||||
|             $($tf)* | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user