MCPcopy
hub / github.com/tinylib/msgp / TestStructLevelLimits

Function TestStructLevelLimits

_generated/limits_test.go:217–230  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

215}
216
217func TestStructLevelLimits(t *testing.T) {
218 // Test that the struct-level map limits are enforced
219 data := LimitTestData{}
220
221 t.Run("StructMap_ExceedsLimit", func(t *testing.T) {
222 // Create a struct with too many fields
223 buf := msgp.AppendMapHeader(nil, 60) // Exceeds map limit of 50
224
225 _, err := data.UnmarshalMsg(buf)
226 if err != msgp.ErrLimitExceeded {
227 t.Errorf("Expected ErrLimitExceeded for struct map, got %v", err)
228 }
229 })
230}
231
232func TestNormalOperationWithinLimits(t *testing.T) {
233 // Test that normal operation works when everything is within limits

Callers

nothing calls this directly

Calls 2

AppendMapHeaderFunction · 0.92
UnmarshalMsgMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…