blob: dafa04ef0259317c6b176eee19d79f207cda1a3b [file] [log] [blame]
# Relative imports in go test -i
# Run tests outside GOPATH.
env GOPATH=$WORK/tmp
# Check that it's safe to pass -i (which installs dependencies in $GOPATH/pkg) to go test.
! stale runtime # don't let test -i overwrite runtime
go test -i ./testimport
-- testimport/p.go --
package p
func F() int { return 1 }
-- testimport/p1/p1.go --
package p1
func F() int { return 1 }
-- testimport/p_test.go --
package p
import (
"./p1"
"testing"
)
func TestF(t *testing.T) {
if F() != p1.F() {
t.Fatal(F())
}
}