FuzzSerialization tests serialization (using deserialization to create an arbitrary object)
FuzzIdempotent ensures that serialize → deserialize gives back the same object (using deserialization to create an arbitrary object initially). This is more of a "semantic" or property-based test than a pure fuzzer, but it is useful.
The latter test found an issue regarding comments where the line comment // with a */ would end up being serialized as /* with a */*/ which broke things. The fix I've implemented for this is to detect this case and serialize it as a line comment. This changes the existing behaviour in another existing unit test.
Add some basic fuzz tests:
FuzzDeserialization
tests deserializationFuzzSerialization
tests serialization (using deserialization to create an arbitrary object)FuzzIdempotent
ensures that serialize → deserialize gives back the same object (using deserialization to create an arbitrary object initially). This is more of a "semantic" or property-based test than a pure fuzzer, but it is useful.The latter test found an issue regarding comments where the line comment
// with a */
would end up being serialized as/* with a */*/
which broke things. The fix I've implemented for this is to detect this case and serialize it as a line comment. This changes the existing behaviour in another existing unit test.