From eb48a028bdea903c2cec9d138d9b8df9ea5d1627 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sat, 18 Nov 2017 15:08:06 -0200 Subject: [PATCH] refactor: improved test code Improved test to better check errors. --- pipeline/build/build_test.go | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/pipeline/build/build_test.go b/pipeline/build/build_test.go index a736995f4..b20022c92 100644 --- a/pipeline/build/build_test.go +++ b/pipeline/build/build_test.go @@ -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) {