ceremonyclient/go-libp2p/p2p/http/auth/internal/handshake/alloc_test.go
Cassandra Heart dbd95bd9e9
v2.1.0 (#439)
* v2.1.0 [omit consensus and adjacent] - this commit will be amended with the full release after the file copy is complete

* 2.1.0 main node rollup
2025-09-30 02:48:15 -05:00

21 lines
547 B
Go

//go:build nocover
package handshake
import "testing"
func TestParsePeerIDAuthSchemeParamsNoAllocNoCover(t *testing.T) {
str := []byte(`libp2p-PeerID peer-id="<server-peer-id-string>", sig="<base64-signature-bytes>", public-key="<base64-encoded-public-key-bytes>", bearer="<base64-encoded-opaque-blob>"`)
allocs := testing.AllocsPerRun(1000, func() {
p := params{}
err := p.parsePeerIDAuthSchemeParams(str)
if err != nil {
t.Fatal(err)
}
})
if allocs > 0 {
t.Fatalf("alloc test failed expected 0 received %0.2f", allocs)
}
}