mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-21 10:27:26 +08:00
* v2.1.0 [omit consensus and adjacent] - this commit will be amended with the full release after the file copy is complete * 2.1.0 main node rollup
31 lines
445 B
Go
31 lines
445 B
Go
//
|
|
// mpint_test.go
|
|
//
|
|
// Copyright (c) 2019 Markku Rossi
|
|
//
|
|
// All rights reserved.
|
|
//
|
|
|
|
package mpint
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
var (
|
|
oneData = []byte{0x1}
|
|
twoData = []byte{0x2}
|
|
threeData = []byte{0x3}
|
|
)
|
|
|
|
func TestMPInt(t *testing.T) {
|
|
one := FromBytes(oneData)
|
|
two := FromBytes(twoData)
|
|
three := FromBytes(threeData)
|
|
|
|
sum := Add(one, two)
|
|
if sum.Cmp(three) != 0 {
|
|
t.Errorf("%s + %s = %s, expected %s\n", one, two, sum, three)
|
|
}
|
|
}
|