}
`
+const exampleWholeFileExternalFunction = `package foo_test
+
+func foo(int)
+
+func Example() {
+ foo(42)
+ // Output:
+}
+`
+
+const exampleWholeFileExternalFunctionOutput = `package main
+
+func foo(int)
+
+func main() {
+ foo(42)
+}
+`
+
var exampleWholeFileTestCases = []struct {
Title, Source, Play, Output string
}{
exampleWholeFileFunctionOutput,
"Hello, world!\n",
},
+ {
+ "ExternalFunction",
+ exampleWholeFileExternalFunction,
+ exampleWholeFileExternalFunctionOutput,
+ "",
+ },
}
func TestExamplesWholeFile(t *testing.T) {