mirror of
https://github.com/golang/go
synced 2024-11-27 05:01:19 -07:00
cmd/pack: avoid ./ import in test (fix Windows build)
It is possible to use ./ imports on Windows but it requires some extra command-line work ('go build' does this automatically, but we can't use 'go build' here). Instead, use an ordinary import and -I/-L, which are easier to use. LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/89040043
This commit is contained in:
parent
6524310770
commit
576318c7bd
@ -247,7 +247,7 @@ func TestLargeDefs(t *testing.T) {
|
|||||||
main := filepath.Join(dir, "main.go")
|
main := filepath.Join(dir, "main.go")
|
||||||
prog := `
|
prog := `
|
||||||
package main
|
package main
|
||||||
import "./large"
|
import "large"
|
||||||
var V large.T
|
var V large.T
|
||||||
func main() {
|
func main() {
|
||||||
println("ok")
|
println("ok")
|
||||||
@ -267,8 +267,8 @@ func TestLargeDefs(t *testing.T) {
|
|||||||
run("go", "build", "cmd/pack") // writes pack binary to dir
|
run("go", "build", "cmd/pack") // writes pack binary to dir
|
||||||
run("go", "tool", char+"g", "large.go")
|
run("go", "tool", char+"g", "large.go")
|
||||||
run("./pack", "grc", "large.a", "large."+char)
|
run("./pack", "grc", "large.a", "large."+char)
|
||||||
run("go", "tool", char+"g", "main.go")
|
run("go", "tool", char+"g", "-I", ".", "main.go")
|
||||||
run("go", "tool", char+"l", "-o", "a.out", "main."+char)
|
run("go", "tool", char+"l", "-L", ".", "-o", "a.out", "main."+char)
|
||||||
out := run("./a.out")
|
out := run("./a.out")
|
||||||
if out != "ok\n" {
|
if out != "ok\n" {
|
||||||
t.Fatal("incorrect output: %q, want %q", out, "ok\n")
|
t.Fatal("incorrect output: %q, want %q", out, "ok\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user