MCPcopy
hub / github.com/cweill/gotests / TestOptions_Process_WithParallel

Function TestOptions_Process_WithParallel

internal/output/options_test.go:294–323  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

292}
293
294func TestOptions_Process_WithParallel(t *testing.T) {
295 options := &Options{
296 Parallel: true,
297 Subtests: true, // Parallel requires subtests
298 }
299 head := &models.Header{
300 Package: "mypackage",
301 }
302 funcs := []*models.Function{
303 {
304 Name: "Add",
305 IsExported: true,
306 Parameters: []*models.Field{
307 {Name: "a", Type: &models.Expression{Value: "int"}},
308 },
309 Results: []*models.Field{
310 {Type: &models.Expression{Value: "int"}},
311 },
312 },
313 }
314
315 got, err := options.Process(head, funcs)
316 if err != nil {
317 t.Errorf("Options.Process() with Parallel error = %v", err)
318 return
319 }
320 if len(got) == 0 {
321 t.Error("Options.Process() returned empty output")
322 }
323}
324
325func TestOptions_providesTemplateData(t *testing.T) {
326 tests := []struct {

Callers

nothing calls this directly

Calls 1

ProcessMethod · 0.95

Tested by

no test coverage detected