(b *testing.B)
| 334 | } |
| 335 | |
| 336 | func BenchmarkStripCacheTrackingFields(b *testing.B) { |
| 337 | data := []byte(`{"data":{"users":{"__gj_id":1,"id":1,"name":"Ada","posts":[{"__gj_id":10,"id":10,"title":"First"},{"id":11,"title":"Second","__gj_id":11}]}}}`) |
| 338 | |
| 339 | b.ReportAllocs() |
| 340 | for i := 0; i < b.N; i++ { |
| 341 | cleaned, err := stripCacheTrackingFields(data) |
| 342 | if err != nil { |
| 343 | b.Fatal(err) |
| 344 | } |
| 345 | if len(cleaned) == 0 { |
| 346 | b.Fatal("empty cleaned response") |
| 347 | } |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | func TestResponseProcessor_InnerFragmentUsesPrimaryKey(t *testing.T) { |
| 352 | qc := &qcode.QCode{ |
nothing calls this directly
no test coverage detected