(b *testing.B)
| 416 | } |
| 417 | |
| 418 | func BenchmarkPrettyPrintInfo(b *testing.B) { |
| 419 | infoWithSwarm := sampleInfoNoSwarm |
| 420 | infoWithSwarm.Swarm = sampleSwarmInfo |
| 421 | |
| 422 | info := dockerInfo{ |
| 423 | Info: &infoWithSwarm, |
| 424 | ClientInfo: &clientInfo{ |
| 425 | clientVersion: clientVersion{ |
| 426 | Platform: &platformInfo{Name: "Docker Engine - Community"}, |
| 427 | Version: "24.0.0", |
| 428 | Context: "default", |
| 429 | }, |
| 430 | Debug: true, |
| 431 | }, |
| 432 | } |
| 433 | cli := test.NewFakeCli(&fakeClient{}) |
| 434 | |
| 435 | b.ReportAllocs() |
| 436 | for i := 0; i < b.N; i++ { |
| 437 | _ = prettyPrintInfo(cli, info) |
| 438 | cli.ResetOutputBuffers() |
| 439 | } |
| 440 | } |
| 441 | |
| 442 | func TestFormatInfo(t *testing.T) { |
| 443 | for _, tc := range []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…