Added failing test case for #42706

This commit is contained in:
Norman B. Lancaster 2020-11-30 16:29:34 -06:00 committed by Daniel Martí
parent 43afb1a220
commit 58eb10ba10
1 changed files with 26 additions and 0 deletions

View File

@ -352,6 +352,26 @@ func main() {
}
`
const exampleWholeFileExternalFunction = `package foo_test
func foo(x int)
func Example() {
foo(42) // External function reference
fmt.Println("Hello, world!")
// Output: Hello, world!
}
`
const exampleWholeFileExternalFunctionOutput = `package main
func foo(x int)
func main() {
fmt.Println("Hello, world!")
}
`
var exampleWholeFileTestCases = []struct {
Title, Source, Play, Output string
}{
@ -367,6 +387,12 @@ var exampleWholeFileTestCases = []struct {
exampleWholeFileFunctionOutput,
"Hello, world!\n",
},
{
"ExternalFunction",
exampleWholeFileExternalFunction,
exampleWholeFileExternalFunctionOutput,
"Hello, world!\n",
},
}
func TestExamplesWholeFile(t *testing.T) {