Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
yushan8 committed Dec 17, 2024
1 parent e66d9b8 commit 1f45778
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions language/go/fileinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,8 +729,6 @@ func countParallel(funcDecl *ast.FuncDecl) int {
if !strings.HasPrefix(funcDecl.Name.Name, "Test") {
return 0
}
fmt.Println("funcDecl:", funcDecl.Name.Name)

ast.Inspect(funcDecl, func(n ast.Node) bool {
call, ok := n.(*ast.CallExpr)
if !ok {
Expand Down
2 changes: 2 additions & 0 deletions language/go/testdata/tests_per_file/BUILD.want
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ go_test(
srcs = ["bar_test.go"],
_gazelle_imports = ["testing"],
embed = [":tests_per_file"],
shard_count = 1,
)

go_test(
Expand All @@ -32,4 +33,5 @@ go_test(
"testing",
],
embed = [":tests_per_file"],
shard_count = 2,
)
2 changes: 1 addition & 1 deletion language/go/testdata/tests_per_file/bar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ package tests_per_file

import "testing"

func TestStuff(t *testing.T) {}
func TestStuff(t *testing.T) { t.Parallel() }
4 changes: 3 additions & 1 deletion language/go/testdata/tests_per_file/foo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ import (

type fileSpec testtools.FileSpec

func TestStuff(t *testing.T) {}
func TestStuff(t *testing.T) { t.Parallel()}

func TestFoo(t *testing.T) { t.Parallel()}

0 comments on commit 1f45778

Please sign in to comment.