Skip to content

Commit

Permalink
add test for util/big.go
Browse files Browse the repository at this point in the history
  • Loading branch information
rohenaz committed Sep 3, 2024
1 parent feb300d commit 2841631
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions util/big_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package util_test

import (
"math/big"
"testing"

"github.com/bitcoin-sv/go-sdk/util"
"github.com/stretchr/testify/require"
)

func TestBigUmod(t *testing.T) {
require.Equal(t, int64(2), util.Umod(big.NewInt(-178), big.NewInt(10)).Int64())
}

func TestBigRandomInt(t *testing.T) {
b := util.NewRandomBigInt(32)
require.NotNil(t, b)
require.Equal(t, 32, len(b.Bytes()))

Check failure on line 18 in util/big_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint (/home/runner/work/go-sdk/go-sdk)

len: use require.Len (testifylint)
}

0 comments on commit 2841631

Please sign in to comment.