fn data_before_headers() {
        let mut s = Session::default().unwrap();
        s.handshake().unwrap();

        let mut d = [42; 128];
        let mut b = octets::OctetsMut::with_slice(&mut d);

        let frame_type = b.put_varint(frame::DATA_FRAME_TYPE_ID).unwrap();
        s.pipe.client.stream_send(0, frame_type, false).unwrap();

        let frame_len = b.put_varint(5).unwrap();
        s.pipe.client.stream_send(0, frame_len, false).unwrap();

        s.pipe.client.stream_send(0, b"hello", false).unwrap();

        s.advance().ok();

        assert_eq!(
            s.server.poll(&mut s.pipe.server),
            Err(Error::FrameUnexpected)
        );
    }
/// Tests that sending DATA before HEADERS causes an error.
Tests that sending DATA before HEADERS causes an error.
Tests that sending DATA before HEADERS causes an error .
fn data_before_headers() {
        let mut s = Session::default().unwrap();
        s.handshake().unwrap();
        let mut d = [42; 128];
        let mut b = octets::OctetsMut::with_slice(&mut d);
        let frame_type = b.put_varint(frame::DATA_FRAME_TYPE_ID).unwrap();
        s.pipe.client.stream_send(0, frame_type, false).unwrap();
        let frame_len = b.put_varint(5).unwrap();
        s.pipe.client.stream_send(0, frame_len, false).unwrap();
        s.pipe.client.stream_send(0, b"hello", false).unwrap();
        s.advance().ok();
        assert_eq!(
            s.server.poll(&mut s.pipe.server),
            Err(Error::FrameUnexpected)
        );
    }
fn data_before_headers ( ) { let mut s = Session :: default ( ) . unwrap ( ) ; s . handshake ( ) . unwrap ( ) ; let mut d = [ 42 ; 128 ] ; let mut b = octets :: OctetsMut :: with_slice ( & mut d ) ; let frame_type = b . put_varint ( frame :: DATA_FRAME_TYPE_ID ) . unwrap ( ) ; s . pipe . client . stream_send ( 0 , frame_type , false ) . unwrap ( ) ; let frame_len = b . put_varint ( 5 ) . unwrap ( ) ; s . pipe . client . stream_send ( 0 , frame_len , false ) . unwrap ( ) ; s . pipe . client . stream_send ( 0 , b" " , false ) . unwrap ( ) ; s . advance ( ) . ok ( ) ; assert_eq ! ( s server poll ( mut s pipe server ) Err ( Error FrameUnexpected ) ) ; }
Tests that sending DATA before HEADERS causes an error.
Tests that sending DATA before HEADERS causes an error .