(b *testing.B)
| 1304 | } |
| 1305 | |
| 1306 | func BenchmarkInjectJSONProperties_Multiple(b *testing.B) { |
| 1307 | newKVs := []KVPair{ |
| 1308 | { |
| 1309 | Key: "newval", |
| 1310 | Val: 123, |
| 1311 | }, |
| 1312 | { |
| 1313 | Key: "test", |
| 1314 | Val: true, |
| 1315 | }, |
| 1316 | { |
| 1317 | Key: "asdf", |
| 1318 | Val: "qwerty", |
| 1319 | }, |
| 1320 | } |
| 1321 | |
| 1322 | tests := []struct { |
| 1323 | input string |
| 1324 | }{ |
| 1325 | { |
| 1326 | input: `null`, |
| 1327 | }, |
| 1328 | { |
| 1329 | input: "{}", |
| 1330 | }, |
| 1331 | { |
| 1332 | input: `{"key":"val"}`, |
| 1333 | }, |
| 1334 | } |
| 1335 | |
| 1336 | for _, test := range tests { |
| 1337 | b.Run(test.input, func(bb *testing.B) { |
| 1338 | for i := 0; i < bb.N; i++ { |
| 1339 | _, _ = InjectJSONProperties([]byte(test.input), newKVs...) |
| 1340 | } |
| 1341 | }) |
| 1342 | } |
| 1343 | } |
| 1344 | |
| 1345 | func BenchmarkPanicRecover(b *testing.B) { |
| 1346 | b.Run("recover panic", func(b *testing.B) { |
nothing calls this directly
no test coverage detected