aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/test_example_goexit.txt
blob: 59219e33660183e665e9a7d956afc020a4260de5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# For issue golang.org/issue/41084
[short] skip

! go test -v examplegoexit
stdout '(?s)--- PASS.*--- FAIL.*'
stdout 'panic: test executed panic\(nil\) or runtime\.Goexit'

-- examplegoexit/example_test.go --
package main

import (
	"fmt"
	"runtime"
)

func ExamplePass() {
	fmt.Println("pass")
	// Output:
	// pass
}

func ExampleGoexit() {
	runtime.Goexit()
	// Output:
}