(t *testing.T)
| 215 | } |
| 216 | |
| 217 | func 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 | |
| 232 | func TestNormalOperationWithinLimits(t *testing.T) { |
| 233 | // Test that normal operation works when everything is within limits |
nothing calls this directly
no test coverage detected
searching dependent graphs…