Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types: tests -> test suites migration #7405

Merged
merged 14 commits into from
Sep 29, 2020
Prev Previous commit
Next Next commit
create named type
  • Loading branch information
Alessio Treglia committed Sep 29, 2020
commit c8565b6297726f0669b6a49645b56c9999f9afd3
9 changes: 6 additions & 3 deletions types/int_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,20 @@ func (s *internalIntTestSuite) TestImmutabilityArithInt() {
}
}

type intOp func(Int, *big.Int) (Int, *big.Int)
type (
intOp func(Int, *big.Int) (Int, *big.Int)
bigIntFunc func(*big.Int, *big.Int, *big.Int) *big.Int
)

func intArithOp(intFn func(Int, Int) Int, bigIntFn func(*big.Int, *big.Int, *big.Int) *big.Int) intOp {
func intArithOp(intFn func(Int, Int) Int, bigIntFn bigIntFunc) intOp {
return func(integer Int, bigInteger *big.Int) (Int, *big.Int) {
r := rand.Int63()
br := new(big.Int).SetInt64(r)
return intFn(integer, NewInt(r)), bigIntFn(new(big.Int), bigInteger, br)
}
}

func intArithRawOp(intFn func(Int, int64) Int, bigIntFn func(*big.Int, *big.Int, *big.Int) *big.Int) intOp {
func intArithRawOp(intFn func(Int, int64) Int, bigIntFn bigIntFunc) intOp {
return func(integer Int, bigInteger *big.Int) (Int, *big.Int) {
r := rand.Int63()
br := new(big.Int).SetInt64(r)
Expand Down