(t *testing.T)
| 77 | } |
| 78 | |
| 79 | func TestReadUTF16LE_SurrogatePair(t *testing.T) { |
| 80 | // Test UTF-16 surrogate pair for emoji: 🎉 (U+1F389) |
| 81 | // UTF-16: D83C DF89 (surrogate pair) |
| 82 | // Little-endian bytes: 3C D8 89 DF |
| 83 | data := []byte{0x3C, 0xD8, 0x89, 0xDF} |
| 84 | buf := NewByteBuffer(data) |
| 85 | err := &Error{} |
| 86 | |
| 87 | result := readUTF16LE(buf, 4, err) |
| 88 | |
| 89 | require.False(t, err.HasError()) |
| 90 | require.Equal(t, "🎉", result) |
| 91 | } |
| 92 | |
| 93 | func TestReadLatin1_OOM_Bug(t *testing.T) { |
| 94 | // We claim a massive size of 10,000 bytes, but provide an empty buffer. |
nothing calls this directly
no test coverage detected