MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / BenchmarkInjectJSONProperties_Multiple

Function BenchmarkInjectJSONProperties_Multiple

base/util_test.go:1306–1343  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

1304}
1305
1306func 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
1345func BenchmarkPanicRecover(b *testing.B) {
1346 b.Run("recover panic", func(b *testing.B) {

Callers

nothing calls this directly

Calls 2

InjectJSONPropertiesFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected