Running a fuzzer is a basic quality-of-implementation task for any parser that wants to be widely used. Because you have a canonical reference format, you can easily implement round-trip verification fuzzing.
// We can round-trip any valid JSON
function fuzzTargetA(payload) {
const expected = try { JSON.parse(payload) } catch { return; };
const result = jcof.decode(jcof.encode(expected));
if (!check_equivalence(expected, result)) { fail(); }
}
// We can encode anything we successfully decode, and it decodes without errors
function fuzzTargetB(payload) {
const expected = try { jcof.decode(payload) } catch { return; };
const result = jcof.decode(jcof.encode(decoded));
if (!check_equivalence(expected, result)) { fail(); }
}
Running a fuzzer is a basic quality-of-implementation task for any parser that wants to be widely used. Because you have a canonical reference format, you can easily implement round-trip verification fuzzing.