(b *testing.B)
| 1246 | } |
| 1247 | |
| 1248 | func BenchmarkInjectJSONPropertiesFromBytes_Multiple(b *testing.B) { |
| 1249 | newKVBytes := KVPairBytes{ |
| 1250 | Key: "newval", |
| 1251 | Val: []byte(`{"abc":123,"nums":["one","two","three"],"test":true}`), |
| 1252 | } |
| 1253 | |
| 1254 | tests := []struct { |
| 1255 | input string |
| 1256 | }{ |
| 1257 | { |
| 1258 | input: `null`, |
| 1259 | }, |
| 1260 | { |
| 1261 | input: "{}", |
| 1262 | }, |
| 1263 | { |
| 1264 | input: `{"key":"val"}`, |
| 1265 | }, |
| 1266 | } |
| 1267 | |
| 1268 | for _, test := range tests { |
| 1269 | b.Run(test.input, func(bb *testing.B) { |
| 1270 | for i := 0; i < bb.N; i++ { |
| 1271 | _, _ = InjectJSONPropertiesFromBytes([]byte(test.input), newKVBytes) |
| 1272 | } |
| 1273 | }) |
| 1274 | } |
| 1275 | } |
| 1276 | |
| 1277 | func BenchmarkInjectJSONProperties(b *testing.B) { |
| 1278 | newKV := KVPair{ |
nothing calls this directly
no test coverage detected