rename/fix the package
This commit is contained in:
15
test/BUILD
15
test/BUILD
@@ -7,18 +7,25 @@ go_library(
|
||||
cgo = True,
|
||||
importpath = "github.com/motiejus/bazel-zig-cc/test",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = ["@com_github_mattn_go_sqlite3//:go-sqlite3"],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "hello",
|
||||
embed = [":hello_lib"],
|
||||
embed = [":test_lib"],
|
||||
static = "on",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "hello_test",
|
||||
name = "test_test",
|
||||
srcs = ["hello_test.go"],
|
||||
embed = [":hello_lib"],
|
||||
embed = [":test_lib"],
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "test_lib",
|
||||
srcs = ["hello.go"],
|
||||
cgo = True,
|
||||
importpath = "git.sr.ht/~motiejus/bazel-zig-cc/test",
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
@@ -9,6 +9,6 @@ func main() {
|
||||
C.printhello()
|
||||
}
|
||||
|
||||
func chello() string {
|
||||
func Chello() string {
|
||||
return C.GoString(C.hello())
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestHello(t *testing.T) {
|
||||
want := "hello, world"
|
||||
got := chello()
|
||||
got := Chello()
|
||||
if got != want {
|
||||
t.Errorf("expected %q, got %q", want, got)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user