(b *testing.B)
| 1275 | } |
| 1276 | |
| 1277 | func BenchmarkInjectJSONProperties(b *testing.B) { |
| 1278 | newKV := KVPair{ |
| 1279 | Key: "newval", |
| 1280 | Val: 123, |
| 1281 | } |
| 1282 | |
| 1283 | tests := []struct { |
| 1284 | input string |
| 1285 | }{ |
| 1286 | { |
| 1287 | input: `null`, |
| 1288 | }, |
| 1289 | { |
| 1290 | input: "{}", |
| 1291 | }, |
| 1292 | { |
| 1293 | input: `{"key":"val"}`, |
| 1294 | }, |
| 1295 | } |
| 1296 | |
| 1297 | for _, test := range tests { |
| 1298 | b.Run(test.input, func(bb *testing.B) { |
| 1299 | for i := 0; i < bb.N; i++ { |
| 1300 | _, _ = InjectJSONProperties([]byte(test.input), newKV) |
| 1301 | } |
| 1302 | }) |
| 1303 | } |
| 1304 | } |
| 1305 | |
| 1306 | func BenchmarkInjectJSONProperties_Multiple(b *testing.B) { |
| 1307 | newKVs := []KVPair{ |
nothing calls this directly
no test coverage detected