1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00

refactor: improved test code

Improved test to better check errors.
This commit is contained in:
Carlos Alexandro Becker 2017-11-18 15:08:06 -02:00 committed by Carlos Alexandro Becker
parent ce9e1c575c
commit eb48a028bd

View File

@ -304,23 +304,11 @@ func exists(file string) bool {
}
func writeMainWithoutMainFunc(t *testing.T, folder string) {
main := `package main
func foo() {
println("foo")
}
`
writeFile(t, folder, main)
writeFile(t, folder, "package main\nfunc notMain() {println(0)}")
}
func writeGoodMain(t *testing.T, folder string) {
main := `package main
func main() {
println("hi")
}
`
writeFile(t, folder, main)
writeFile(t, folder, "package main\nfunc main() {println(0)}")
}
func writeFile(t *testing.T, folder, content string) {