ensure that tests with separate packages work

pull/22/head
Daniel Martí 5 years ago
parent 30524ea282
commit 2067ad57aa

@ -2,11 +2,12 @@ exec go test -v
stdout 'PASS.*TestFoo'
garble test -c -vet=off
bingrep bar.test$exe 'TestFoo'
bingrep bar.test$exe 'TestFoo' 'TestSeparateFoo'
! bingrep bar.test$exe 'ImportedVar'
exec ./bar.test -test.v
stdout 'PASS.*TestFoo'
stdout 'PASS.*TestSeparateFoo'
-- go.mod --
module foo.com/bar
@ -29,3 +30,18 @@ func TestFoo(t *testing.T) {
t.FailNow()
}
}
-- bar_separate_test.go --
package bar_test
import (
"testing"
"foo.com/bar"
)
func TestSeparateFoo(t *testing.T) {
t.Log(bar.ImportedVar)
if bar.Foo() != "Foo" {
t.FailNow()
}
}

Loading…
Cancel
Save