Skip to content

Commit

Permalink
Add tests for same package
Browse files Browse the repository at this point in the history
  • Loading branch information
sluongng committed May 11, 2022
1 parent fee2095 commit d10b680
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/core/go_test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,27 @@ go_library(
deps = [":indirect_import_lib"],
)

[
go_library(
name = "same_package_{}".format(i),
srcs = ["same_package.go"],
importpath = "github.com/bazelbuild/rules_go/tests/core/go_test/same_package_{}".format(i),
x_defs = {
"name": "{}".format(i),
},
)
for i in range(1, 80)
]

[
go_test(
name = "same_package_{}_test".format(i),
srcs = ["same_package_test.go"],
embed = [":same_package_{}".format(i)],
)
for i in range(1, 80)
]

go_bazel_test(
name = "testmain_without_exit_test",
srcs = ["testmain_without_exit_test.go"],
Expand Down
3 changes: 3 additions & 0 deletions tests/core/go_test/same_package.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package same_package

var name string
11 changes: 11 additions & 0 deletions tests/core/go_test/same_package_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package same_package

import (
"testing"
)

func OkTest(t *testing.T) {
if name == "" {
t.Errorf("expected name to be non empty")
}
}

0 comments on commit d10b680

Please sign in to comment.