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

Function TestMapExceedsLimit

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

Source from the content-addressed store, hash-verified

200}
201
202func TestMapExceedsLimit(t *testing.T) {
203 data := UnlimitedData{}
204
205 t.Run("Map_ExceedsLimit", func(t *testing.T) {
206 buf := msgp.AppendMapHeader(nil, 1)
207 buf = msgp.AppendString(buf, "big_map")
208 buf = msgp.AppendMapHeader(buf, 60) // Exceeds map limit of 50
209
210 _, err := data.UnmarshalMsg(buf)
211 if err != msgp.ErrLimitExceeded {
212 t.Errorf("Expected ErrLimitExceeded for map, got %v", err)
213 }
214 })
215}
216
217func TestStructLevelLimits(t *testing.T) {
218 // Test that the struct-level map limits are enforced

Callers

nothing calls this directly

Calls 3

AppendMapHeaderFunction · 0.92
AppendStringFunction · 0.92
UnmarshalMsgMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…