mirror of
https://github.com/pion/stun.git
synced 2025-10-28 18:02:03 +08:00
24 lines
469 B
Go
24 lines
469 B
Go
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
// Package testutil contains helpers and utilities for writing tests
|
|
package testutil
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
// ShouldNotAllocate fails if f allocates.
|
|
func ShouldNotAllocate(t *testing.T, f func()) {
|
|
t.Helper()
|
|
|
|
if Race {
|
|
t.Skip("skip while running with -race")
|
|
|
|
return
|
|
}
|
|
assert.Zero(t, testing.AllocsPerRun(10, f))
|
|
}
|