Skip to content

Commit 63451c4

Browse files
committed
Fix CBOR.Aiken tests for refactored Text API
- Update Text.toBytesUnsafe to Text.toBytes - UTF-8 encoding matches Aiken spec
1 parent 61ffded commit 63451c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/evolution/test/CBOR.Aiken.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,16 +493,16 @@ describe("Aiken CBOR Encoding Compatibility", () => {
493493

494494
// Test #56: encode_string_ascii
495495
it("encode_string_ascii: should encode 'hello' as bytearray", () => {
496-
const value = Text.toBytesUnsafe("hello")
496+
const value = Text.toBytes("hello")
497497
const encoded = Data.toCBORHex(value, CBOR.AIKEN_DEFAULT_OPTIONS)
498498
expect(encoded).toBe("4568656c6c6f")
499499
})
500500

501501
// Test #57: encode_string_unicode
502502
it("encode_string_unicode: should encode 'café' as bytearray", () => {
503-
const value = Text.toBytesUnsafe("café")
503+
const value = Text.toBytes("café")
504504
const encoded = Data.toCBORHex(value, CBOR.AIKEN_DEFAULT_OPTIONS)
505-
expect(encoded).toBe("45636166c3a9")
505+
expect(encoded).toBe("45636166c3a9") // UTF-8 encoding of "café"
506506
})
507507

508508
// Test #58: encode_bool_true

0 commit comments

Comments
 (0)