(t *testing.T)
| 38 | } |
| 39 | |
| 40 | func TestReadUTF16LE_OddByteCount(t *testing.T) { |
| 41 | // Test edge case: odd byte count (malformed UTF-16 data). |
| 42 | // This should return a typed decode error rather than silently truncating. |
| 43 | data := []byte{0x48, 0x00, 0x69, 0x00, 0xFF} |
| 44 | buf := NewByteBuffer(data) |
| 45 | err := &Error{} |
| 46 | |
| 47 | result := readUTF16LE(buf, 5, err) |
| 48 | |
| 49 | require.True(t, err.HasError()) |
| 50 | require.Equal(t, ErrKindInvalidUTF16String, err.Kind()) |
| 51 | require.Equal(t, "", result) |
| 52 | } |
| 53 | |
| 54 | func TestReadUTF16LE_SingleByte(t *testing.T) { |
| 55 | // Test edge case: single byte (no complete UTF-16 code units) |
nothing calls this directly
no test coverage detected