aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/list_test_simple.txt
blob: 954897c663c8744c26f908f6983519333606bc89 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
[short] skip

# Test
go test -list=Test
stdout TestSimple

# Benchmark
go test -list=Benchmark
stdout BenchmarkSimple

# Examples
go test -list=Example
stdout ExampleSimple
stdout ExampleWithEmptyOutput

-- go.mod --
module m

go 1.16
-- bench_test.go --
package testlist

import (
	"fmt"
	"testing"
)

func BenchmarkSimplefunc(b *testing.B) {
	b.StopTimer()
	b.StartTimer()
	for i := 0; i < b.N; i++ {
		_ = fmt.Sprint("Test for bench")
	}
}
-- example_test.go --
package testlist

import (
	"fmt"
)

func ExampleSimple() {
	fmt.Println("Test with Output.")

	// Output: Test with Output.
}

func ExampleWithEmptyOutput() {
	fmt.Println("")

	// Output:
}

func ExampleNoOutput() {
	_ = fmt.Sprint("Test with no output")
}
-- test_test.go --
package testlist

import (
	"fmt"
	"testing"
)

func TestSimple(t *testing.T) {
	_ = fmt.Sprint("Test simple")
}