Add proptest to check dc_header_{encode,decode}

This commit is contained in:
Dmitry Bogatov
2019-09-23 19:46:18 +00:00
committed by holger krekel
parent 33b98a15d3
commit 96fbeb583b

View File

@@ -383,5 +383,13 @@ mod tests {
// make sure this never panics
let _decoded = dc_decode_ext_header(&buf);
}
#[test]
fn test_dc_header_roundtrip(input: String) {
let encoded = unsafe { dc_encode_header_words(&input) };
let decoded = dc_decode_header_words_safe(&encoded);
assert_eq!(input, decoded);
}
}
}