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:
parent
ce9e1c575c
commit
eb48a028bd
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user