aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/test_no_run_example.txt
blob: 66daa310fa32141786866f71ecb3232b18d0681c (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
26
go test -v norunexample
stdout 'File with non-runnable example was built.'

-- norunexample/example_test.go --
package pkg_test

import "os"

func init() {
	os.Stdout.Write([]byte("File with non-runnable example was built.\n"))
}

func Example_test() {
	// This test will not be run, it has no "Output:" comment.
}
-- norunexample/test_test.go --
package pkg

import (
	"os"
	"testing"
)

func TestBuilt(t *testing.T) {
	os.Stdout.Write([]byte("A normal test was executed.\n"))
}