test(headers): Add tests for single value headers.
This commit is contained in:
		| @@ -202,7 +202,7 @@ macro_rules! header { | ||||
|         } | ||||
|     }; | ||||
|     // Single value header | ||||
|     ($(#[$a:meta])*($id:ident, $n:expr) => [$value:ty]) => { | ||||
|     ($(#[$a:meta])*($id:ident, $n:expr) => [$value:ty] $tm:ident{$($tf:item)*}) => { | ||||
|         $(#[$a])* | ||||
|         #[derive(Clone, Debug, PartialEq)] | ||||
|         pub struct $id(pub $value); | ||||
| @@ -225,6 +225,15 @@ macro_rules! header { | ||||
|                 ::std::fmt::Display::fmt(&**self, f) | ||||
|             } | ||||
|         } | ||||
|         #[allow(unused_imports)] | ||||
|         mod $tm{ | ||||
|             use std::str; | ||||
|             use $crate::header::*; | ||||
|             use $crate::mime::*; | ||||
|             use $crate::method::Method; | ||||
|             use super::$id as HeaderField; | ||||
|             $($tf)* | ||||
|         } | ||||
|     }; | ||||
|     // List header, one or more items with "*" option | ||||
|     ($(#[$a:meta])*($id:ident, $n:expr) => {Any / ($item:ty)+} $tm:ident{$($tf:item)*}) => { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user