Add some test stubs
This commit is contained in:
		
							
								
								
									
										21
									
								
								tests/flow_control.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								tests/flow_control.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | |||||||
|  |  | ||||||
|  | #[test] | ||||||
|  | #[ignore] | ||||||
|  | fn expand_window_sends_window_update() { | ||||||
|  | } | ||||||
|  |  | ||||||
|  | #[test] | ||||||
|  | #[ignore] | ||||||
|  | fn expand_window_calls_are_coalesced() { | ||||||
|  | } | ||||||
|  |  | ||||||
|  | #[test] | ||||||
|  | #[ignore] | ||||||
|  | fn recv_data_overflows_window() { | ||||||
|  | } | ||||||
|  |  | ||||||
|  | #[test] | ||||||
|  | #[ignore] | ||||||
|  | fn recv_window_update_causes_overflow() { | ||||||
|  |     // A received window update causes the window to overflow. | ||||||
|  | } | ||||||
							
								
								
									
										72
									
								
								tests/ping_pong.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								tests/ping_pong.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,72 @@ | |||||||
|  | pub mod support; | ||||||
|  | use support::*; | ||||||
|  |  | ||||||
|  | use h2::Frame; | ||||||
|  |  | ||||||
|  | #[test] | ||||||
|  | #[ignore] | ||||||
|  | fn recv_single_ping() { | ||||||
|  |     let _ = ::env_logger::init(); | ||||||
|  |  | ||||||
|  |     let mock = mock_io::Builder::new() | ||||||
|  |         .handshake() | ||||||
|  |         /* | ||||||
|  |         .write(&[ | ||||||
|  |             // POST / | ||||||
|  |             0, 0, 16, 1, 4, 0, 0, 0, 1, 131, 135, 65, 139, 157, 41, | ||||||
|  |             172, 75, 143, 168, 233, 25, 151, 33, 233, 132, | ||||||
|  |         ]) | ||||||
|  |         .write(&[ | ||||||
|  |             // DATA | ||||||
|  |             0, 0, 5, 0, 1, 0, 0, 0, 1, 104, 101, 108, 108, 111, | ||||||
|  |         ]) | ||||||
|  |         .write(frames::SETTINGS_ACK) | ||||||
|  |         // Read response | ||||||
|  |         .read(&[ | ||||||
|  |             // HEADERS | ||||||
|  |             0, 0, 1, 1, 4, 0, 0, 0, 1, 136, | ||||||
|  |             // DATA | ||||||
|  |             0, 0, 5, 0, 1, 0, 0, 0, 1, 119, 111, 114, 108, 100 | ||||||
|  |         ]) | ||||||
|  |         */ | ||||||
|  |         .build(); | ||||||
|  |  | ||||||
|  |     let h2 = client::handshake(mock) | ||||||
|  |         .wait().unwrap(); | ||||||
|  |  | ||||||
|  |     /* | ||||||
|  |     // Send the request | ||||||
|  |     let mut request = request::Head::default(); | ||||||
|  |     request.method = method::POST; | ||||||
|  |     request.uri = "https://http2.akamai.com/".parse().unwrap(); | ||||||
|  |     let h2 = h2.send_request(1.into(), request, false).wait().unwrap(); | ||||||
|  |  | ||||||
|  |     // Send the data | ||||||
|  |     let b = [0; 300]; | ||||||
|  |     let h2 = h2.send_data(1.into(), (&b[..]).into(), true).wait().unwrap(); | ||||||
|  |  | ||||||
|  |     // Get the response headers | ||||||
|  |     let (resp, h2) = h2.into_future().wait().unwrap(); | ||||||
|  |  | ||||||
|  |     match resp.unwrap() { | ||||||
|  |         Frame::Headers { headers, .. } => { | ||||||
|  |             assert_eq!(headers.status, status::OK); | ||||||
|  |         } | ||||||
|  |         _ => panic!("unexpected frame"), | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     // Get the response body | ||||||
|  |     let (data, h2) = h2.into_future().wait().unwrap(); | ||||||
|  |  | ||||||
|  |     match data.unwrap() { | ||||||
|  |         Frame::Data { id, data, end_of_stream, .. } => { | ||||||
|  |             assert_eq!(id, 1.into()); | ||||||
|  |             assert_eq!(data, &b"world"[..]); | ||||||
|  |             assert!(end_of_stream); | ||||||
|  |         } | ||||||
|  |         _ => panic!("unexpected frame"), | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     assert!(Stream::wait(h2).next().is_none());; | ||||||
|  |     */ | ||||||
|  | } | ||||||
							
								
								
									
										4
									
								
								tests/trailers.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								tests/trailers.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | |||||||
|  |  | ||||||
|  | #[test] | ||||||
|  | fn recv_trailers_without_eos() { | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user