mirror of https://github.com/golang/go.git
Added failing test case for #42706
This commit is contained in:
parent
43afb1a220
commit
58eb10ba10
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue