corso/src/internal/tester/testing.go
Keepers d7fe518007
rename /internal/testing to /tester (#463)
The alias of testing to ctesting prevented auto-importing
of the testing library.  This change (arbitrarily) renames
the package so that it doesn't collide with the core pkg
for "testing".
2022-08-02 12:21:14 -06:00

27 lines
400 B
Go

package tester
import (
"reflect"
"runtime"
"testing"
"github.com/stretchr/testify/assert"
)
// AreSameFunc asserts whether the two funcs are the same func.
func AreSameFunc(t *testing.T, expect, have any) {
assert.Equal(
t,
runtime.FuncForPC(
reflect.
ValueOf(expect).
Pointer(),
).Name(),
runtime.FuncForPC(
reflect.
ValueOf(have).
Pointer(),
).Name(),
)
}