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

Function TestReadUTF16LE_EmptyBuffer

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

Source from the content-addressed store, hash-verified

65}
66
67func TestReadUTF16LE_EmptyBuffer(t *testing.T) {
68 // Test edge case: zero bytes
69 data := []byte{}
70 buf := NewByteBuffer(data)
71 err := &Error{}
72
73 result := readUTF16LE(buf, 0, err)
74
75 require.False(t, err.HasError())
76 require.Equal(t, "", result)
77}
78
79func TestReadUTF16LE_SurrogatePair(t *testing.T) {
80 // Test UTF-16 surrogate pair for emoji: 🎉 (U+1F389)

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected