goose: read tests from testdata

Since tests are all written in terms of Go source, it makes tests easier
to write.  They still need to be arranged in a GOPATH for go build, but
tests that just call Generate can operate in-place because I've faked
the filesystem.

Reviewed-by: Tuo Shan <shantuo@google.com>
Reviewed-by: Herbie Ong <herbie@google.com>
This commit is contained in:
Ross Light
2018-03-29 15:17:58 -07:00
parent c9506b42e5
commit b92ac73ae3
32 changed files with 578 additions and 331 deletions

View File

@@ -0,0 +1,20 @@
package main
import "fmt"
func main() {
fmt.Println(injectFooBar())
}
type Foo int
type FooBar int
//goose:provide Set
func provideFoo() Foo {
return 41
}
//goose:provide Set
func provideFooBar(foo Foo) FooBar {
return FooBar(foo) + 1
}