Versions in this module Expand all Collapse all go1 go1.18.10 Jan 10, 2023 Changes in this version + func AllocsPerRun(runs int, f func()) (avg float64) + func CoverMode() string + func Coverage() float64 + func Init() + func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, ...) + func RegisterCover(c Cover) + func RunBenchmarks(matchString func(pat, str string) (bool, error), ...) + func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool) + func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool) + func Short() bool + func Verbose() bool + type B struct + N int + func (b *B) ReportAllocs() + func (b *B) ReportMetric(n float64, unit string) + func (b *B) ResetTimer() + func (b *B) Run(name string, f func(b *B)) bool + func (b *B) RunParallel(body func(*PB)) + func (b *B) SetBytes(n int64) + func (b *B) SetParallelism(p int) + func (b *B) StartTimer() + func (b *B) StopTimer() + func (c *B) Cleanup(f func()) + func (c *B) Error(args ...any) + func (c *B) Errorf(format string, args ...any) + func (c *B) Fail() + func (c *B) FailNow() + func (c *B) Failed() bool + func (c *B) Fatal(args ...any) + func (c *B) Fatalf(format string, args ...any) + func (c *B) Helper() + func (c *B) Log(args ...any) + func (c *B) Logf(format string, args ...any) + func (c *B) Name() string + func (c *B) Setenv(key, value string) + func (c *B) Skip(args ...any) + func (c *B) SkipNow() + func (c *B) Skipf(format string, args ...any) + func (c *B) Skipped() bool + func (c *B) TempDir() string + type BenchmarkResult struct + Bytes int64 + Extra map[string]float64 + MemAllocs uint64 + MemBytes uint64 + N int + T time.Duration + func Benchmark(f func(b *B)) BenchmarkResult + func (r BenchmarkResult) AllocedBytesPerOp() int64 + func (r BenchmarkResult) AllocsPerOp() int64 + func (r BenchmarkResult) MemString() string + func (r BenchmarkResult) NsPerOp() int64 + func (r BenchmarkResult) String() string + type Cover struct + Blocks map[string][]CoverBlock + Counters map[string][]uint32 + CoveredPackages string + Mode string + type CoverBlock struct + Col0 uint16 + Col1 uint16 + Line0 uint32 + Line1 uint32 + Stmts uint16 + type F struct + func (c *F) Cleanup(f func()) + func (c *F) Error(args ...any) + func (c *F) Errorf(format string, args ...any) + func (c *F) FailNow() + func (c *F) Failed() bool + func (c *F) Fatal(args ...any) + func (c *F) Fatalf(format string, args ...any) + func (c *F) Log(args ...any) + func (c *F) Logf(format string, args ...any) + func (c *F) Name() string + func (c *F) Setenv(key, value string) + func (c *F) Skip(args ...any) + func (c *F) SkipNow() + func (c *F) Skipf(format string, args ...any) + func (c *F) TempDir() string + func (f *F) Add(args ...any) + func (f *F) Fail() + func (f *F) Fuzz(ff any) + func (f *F) Helper() + func (f *F) Skipped() bool + type InternalBenchmark struct + F func(b *B) + Name string + type InternalExample struct + F func() + Name string + Output string + Unordered bool + type InternalFuzzTarget struct + Fn func(f *F) + Name string + type InternalTest struct + F func(*T) + Name string + type M struct + func MainStart(deps testDeps, tests []InternalTest, benchmarks []InternalBenchmark, ...) *M + func (m *M) Run() (code int) + type PB struct + func (pb *PB) Next() bool + type T struct + func (c *T) Cleanup(f func()) + func (c *T) Error(args ...any) + func (c *T) Errorf(format string, args ...any) + func (c *T) Fail() + func (c *T) FailNow() + func (c *T) Failed() bool + func (c *T) Fatal(args ...any) + func (c *T) Fatalf(format string, args ...any) + func (c *T) Helper() + func (c *T) Log(args ...any) + func (c *T) Logf(format string, args ...any) + func (c *T) Name() string + func (c *T) Skip(args ...any) + func (c *T) SkipNow() + func (c *T) Skipf(format string, args ...any) + func (c *T) Skipped() bool + func (c *T) TempDir() string + func (t *T) Deadline() (deadline time.Time, ok bool) + func (t *T) Parallel() + func (t *T) Run(name string, f func(t *T)) bool + func (t *T) Setenv(key, value string) + type TB interface + Cleanup func(func()) + Error func(args ...any) + Errorf func(format string, args ...any) + Fail func() + FailNow func() + Failed func() bool + Fatal func(args ...any) + Fatalf func(format string, args ...any) + Helper func() + Log func(args ...any) + Logf func(format string, args ...any) + Name func() string + Setenv func(key, value string) + Skip func(args ...any) + SkipNow func() + Skipf func(format string, args ...any) + Skipped func() bool + TempDir func() string