~nickbp/tokio-scgi

eed6dda105c72b38aad6418df648fb6f9c2a43a4 — Nick Parker 4 years ago 6dd036f
Fix 'doesnt crash' decoding tests: actually pass in the data
1 files changed, 11 insertions(+), 3 deletions(-)

M tests/property_tests.rs
M tests/property_tests.rs => tests/property_tests.rs +11 -3
@@ 103,9 103,17 @@ fn encode_decode_empty_body() {

proptest! {
    #[test]
    fn decode_doesnt_crash(s in ".*") {
        let mut buf = BytesMut::with_capacity(s.len());
        ServerCodec::new().decode(&mut buf)?;
    fn server_decode_doesnt_crash(s in ".*") {
        let mut buf = BytesMut::from(s.as_bytes());
        // ignore any io errors, they're expected
        let _ = ServerCodec::new().decode(&mut buf);
    }

    #[test]
    fn client_decode_doesnt_crash(s in ".*") {
        let mut buf = BytesMut::from(s.as_bytes());
        // ignore any io errors, they're expected
        let _ = ClientCodec::new().decode(&mut buf)?;
    }

    #[test]