mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
Co-authored-by: Antoine Wacheux <[email protected]> Co-authored-by: Maxence Maireaux <[email protected]> Co-authored-by: Brieuc Caillot <[email protected]>
21 lines
420 B
Go
21 lines
420 B
Go
package testing
|
|
|
|
import (
|
|
"math/big"
|
|
"testing"
|
|
|
|
"github.com/google/go-cmp/cmp"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func bigIntComparer(v1 *big.Int, v2 *big.Int) bool {
|
|
return v1.String() == v2.String()
|
|
}
|
|
|
|
func RequireEqual(t *testing.T, expected, actual any) {
|
|
t.Helper()
|
|
if diff := cmp.Diff(expected, actual, cmp.Comparer(bigIntComparer)); diff != "" {
|
|
require.Failf(t, "Content not matching", diff)
|
|
}
|
|
}
|