MCPcopy
hub / github.com/github/git-sizer / BenchmarkTenPrograms

Function BenchmarkTenPrograms

internal/pipe/pipeline_test.go:802–824  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

800}
801
802func BenchmarkTenPrograms(b *testing.B) {
803 ctx := context.Background()
804
805 for i := 0; i < b.N; i++ {
806 p := pipe.New()
807 p.Add(
808 pipe.Command("echo", "hello world"),
809 pipe.Command("cat"),
810 pipe.Command("cat"),
811 pipe.Command("cat"),
812 pipe.Command("cat"),
813 pipe.Command("cat"),
814 pipe.Command("cat"),
815 pipe.Command("cat"),
816 pipe.Command("cat"),
817 pipe.Command("cat"),
818 )
819 out, err := p.Output(ctx)
820 if assert.NoError(b, err) {
821 assert.EqualValues(b, "hello world\n", out)
822 }
823 }
824}
825
826func BenchmarkTenFunctions(b *testing.B) {
827 ctx := context.Background()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
CommandFunction · 0.92
OutputMethod · 0.80
AddMethod · 0.65

Tested by

no test coverage detected