(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestExecuteConcurrency(t *testing.T) { |
| 10 | l := NewInMemLoader() |
| 11 | l.Set("foo", "{{if true}}Hi {{ .Name }}!{{end}}") |
| 12 | |
| 13 | set := NewSet(l) |
| 14 | |
| 15 | tpl, err := set.GetTemplate("foo") |
| 16 | if err != nil { |
| 17 | t.Errorf("getting template from set: %v", err) |
| 18 | } |
| 19 | |
| 20 | for i := 0; i < 100; i++ { |
| 21 | t.Run(fmt.Sprintf("CC_%d", i), func(t *testing.T) { |
| 22 | t.Parallel() |
| 23 | |
| 24 | err := tpl.Execute(ioutil.Discard, nil, struct{ Name string }{Name: "John"}) |
| 25 | if err != nil { |
| 26 | t.Errorf("executing template: %v", err) |
| 27 | } |
| 28 | }) |
| 29 | } |
| 30 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…