MCPcopy Index your code
hub / github.com/bitfield/script / TestExecForEach_RunsEchoWithABCAndGetsOutputABC

Function TestExecForEach_RunsEchoWithABCAndGetsOutputABC

script_unix_test.go:66–80  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestExecForEach_RunsEchoWithABCAndGetsOutputABC(t *testing.T) {
67 t.Parallel()
68 p := script.Echo("a\nb\nc\n").ExecForEach("echo {{.}}")
69 if p.Error() != nil {
70 t.Fatal(p.Error())
71 }
72 want := "a\nb\nc\n"
73 got, err := p.String()
74 if err != nil {
75 t.Fatal(err)
76 }
77 if want != got {
78 t.Error(cmp.Diff(want, got))
79 }
80}
81
82func TestExecForEach_CorrectlyEvaluatesTemplateContainingIfStatement(t *testing.T) {
83 t.Parallel()

Callers

nothing calls this directly

Calls 4

EchoFunction · 0.92
ExecForEachMethod · 0.80
ErrorMethod · 0.80
StringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…