MCPcopy Create free account
hub / github.com/apache/fory / TestReadUTF16LE_SingleByte

Function TestReadUTF16LE_SingleByte

go/fory/string_test.go:54–65  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestReadUTF16LE_SingleByte(t *testing.T) {
55 // Test edge case: single byte (no complete UTF-16 code units)
56 data := []byte{0x48}
57 buf := NewByteBuffer(data)
58 err := &Error{}
59
60 result := readUTF16LE(buf, 1, err)
61
62 require.True(t, err.HasError())
63 require.Equal(t, ErrKindInvalidUTF16String, err.Kind())
64 require.Equal(t, "", result)
65}
66
67func TestReadUTF16LE_EmptyBuffer(t *testing.T) {
68 // Test edge case: zero bytes

Callers

nothing calls this directly

Calls 5

HasErrorMethod · 0.95
KindMethod · 0.95
NewByteBufferFunction · 0.85
readUTF16LEFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected