MCPcopy Create free account
hub / github.com/temporalio/temporal / TestProcessFile

Function TestProcessFile

tools/parallelize/parallelize_test.go:11–143  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestProcessFile(t *testing.T) {
12 t.Parallel()
13
14 tests := []struct {
15 name string
16 input string
17 expected string
18 }{
19 {
20 name: "adds t.Parallel to multiple tests",
21 input: `package foo_test
22
23import "testing"
24
25func TestFoo(t *testing.T) {
26 t.Log("foo")
27}
28
29func TestBar(t *testing.T) {
30 t.Log("bar")
31}
32`,
33 expected: `package foo_test
34
35import "testing"
36
37func TestFoo(t *testing.T) {
38 t.Parallel()
39 t.Log("foo")
40}
41
42func TestBar(t *testing.T) {
43 t.Parallel()
44 t.Log("bar")
45}
46`,
47 },
48 {
49 name: "skips test that already has t.Parallel",
50 input: `package foo_test
51
52import "testing"
53
54func TestFoo(t *testing.T) {
55 t.Parallel()
56 t.Log("hello")
57}
58`,
59 expected: `package foo_test
60
61import "testing"
62
63func TestFoo(t *testing.T) {
64 t.Parallel()
65 t.Log("hello")
66}
67`,
68 },

Callers

nothing calls this directly

Calls 5

processFileFunction · 0.85
NoErrorMethod · 0.80
RunMethod · 0.65
ReadFileMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected