import { encodeTextAsBinary, decodeTextFromBinary } from "./text"; describe("unicode text encoding", () => { test("simple unicode text can be encoded", function() { const text = "aAàÃ"; const encoded = encodeTextAsBinary(text); const expected = Uint8Array.from([97, 65, 195, 160, 195, 131]); expect(encoded).toEqual(expected); }); test("simple unicode text can be decoded", function() { const encoded = Uint8Array.from([97, 65, 195, 160, 195, 131]); const decoded = decodeTextFromBinary(encoded); const expected = "aAàÃ"; expect(decoded).toEqual(expected); }); });