test(headers): Allow tests inside list header macros, add tests.
Adds test cases from the relevant RFCs for a few headers. See also: #468, do we want the test cases rendered as examples in the docs?
This commit is contained in:
		| @@ -26,6 +26,18 @@ header! { | ||||
|     #[doc="protocol-version = token"] | ||||
|     #[doc="```"] | ||||
|     (Upgrade, "Upgrade") => (Protocol)+ | ||||
|  | ||||
|     test_upgrade { | ||||
|         test_header!( | ||||
|             test1, | ||||
|             vec![b"HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11"], | ||||
|             Some(HeaderField(vec![ | ||||
|                 Protocol::ProtocolExt("HTTP/2.0".to_string()), | ||||
|                 Protocol::ProtocolExt("SHTTP/1.3".to_string()), | ||||
|                 Protocol::ProtocolExt("IRC/6.9".to_string()), | ||||
|                 Protocol::ProtocolExt("RTA/x11".to_string()), | ||||
|                 ]))); | ||||
|     } | ||||
| } | ||||
|  | ||||
| /// Protocol values that can appear in the Upgrade header. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user