mongodb / bson-rust

Encoding and decoding support for BSON in Rust
MIT License
405 stars 134 forks source link

test(fuzz): read -> write bson #500

Closed LeoDog896 closed 1 month ago

LeoDog896 commented 1 month ago

Runs to_writer in fuzz tests. Makes the fuzzer slower, but covers any write errors. Also adds a fuzz test for from_slice_utf8_lossy.

Note: I did not check for equivalence in from_reader and to_writer, as, even for accounting for length, there is still some loss in data ordering from the reader, as is to be expected.

abr-egn commented 1 month ago

Thank you, this is a very reasonable addition! I've tagged in Isabel for final approval.