X7ROOT File Manager
Current Path:
/opt/golang/1.17.2/src/testing
opt
/
golang
/
1.17.2
/
src
/
testing
/
📁
..
📄
allocs.go
(1.36 KB)
📄
allocs_test.go
(825 B)
📄
benchmark.go
(22.81 KB)
📄
benchmark_test.go
(4.4 KB)
📄
cover.go
(3.26 KB)
📄
example.go
(2.71 KB)
📄
export_test.go
(207 B)
📁
fstest
📄
helper_test.go
(2.82 KB)
📄
helperfuncs_test.go
(1.57 KB)
📁
internal
📁
iotest
📄
match.go
(3.51 KB)
📄
match_test.go
(5.11 KB)
📄
panic_test.go
(6.04 KB)
📁
quick
📄
run_example.go
(1.27 KB)
📄
run_example_js.go
(1.74 KB)
📄
sub_test.go
(22.6 KB)
📄
testing.go
(56.09 KB)
📄
testing_test.go
(4.72 KB)
Editing: allocs_test.go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package testing_test import "testing" var global interface{} var allocsPerRunTests = []struct { name string fn func() allocs float64 }{ {"alloc *byte", func() { global = new(*byte) }, 1}, {"alloc complex128", func() { global = new(complex128) }, 1}, {"alloc float64", func() { global = new(float64) }, 1}, {"alloc int32", func() { global = new(int32) }, 1}, {"alloc byte", func() { global = new(byte) }, 1}, } func TestAllocsPerRun(t *testing.T) { for _, tt := range allocsPerRunTests { if allocs := testing.AllocsPerRun(100, tt.fn); allocs != tt.allocs { t.Errorf("AllocsPerRun(100, %s) = %v, want %v", tt.name, allocs, tt.allocs) } } }
Upload File
Create Folder