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

Function BenchmarkInjectJSONPropertiesFromBytes_Multiple

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

Source from the content-addressed store, hash-verified

1246}
1247
1248func 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
1277func BenchmarkInjectJSONProperties(b *testing.B) {
1278 newKV := KVPair{

Callers

nothing calls this directly

Calls 2

RunMethod · 0.65

Tested by

no test coverage detected