File: allocate_go120_test.go

package info (click to toggle)
golang-github-multiformats-go-multihash 0.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 376 kB
  • sloc: sh: 138; makefile: 39
file content (12 lines) | stat: -rw-r--r-- 226 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
//go:build go1.20

package multihash

import "testing"

func mustNotAllocateMore(t *testing.T, n float64, f func()) {
	t.Helper()
	if b := testing.AllocsPerRun(10, f); b > n {
		t.Errorf("it allocated %f max %f !", b, n)
	}
}