Closed shuse2 closed 1 year ago
With any value which can be successfully decoded, encode(decode(val)) == val should be true.
encode(decode(val)) == val
it('utf8 test', () => { const input = Buffer.from([0x01, 0xff]); const [s, ] = readString(input, 0); const output = writeString(s); expect(input).toBe(output); }); it('utf8 test 2', () => { const input = "ä"; const input2 = "ä"; const output = writeString(input); const output2 = writeString(input2); expect(Buffer.compare(output, output2)).toBe(0); });
Add fuzz test to check random values
Expected behavior
With any value which can be successfully decoded,
encode(decode(val)) == val
should be true.Actual behavior
Steps to reproduce
Add fuzz test to check random values