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
42 lines
538 B
Go
42 lines
538 B
Go
//
|
|
// Copyright (c) 2023 Markku Rossi
|
|
//
|
|
// All rights reserved.
|
|
//
|
|
|
|
package mpa
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
type int128Test struct {
|
|
a int64
|
|
b int64
|
|
r string
|
|
}
|
|
|
|
var lsh128Tests = []int128Test{
|
|
{
|
|
a: 1,
|
|
b: 64,
|
|
r: "10000000000000000",
|
|
},
|
|
{
|
|
a: 1,
|
|
b: 128,
|
|
r: "0",
|
|
},
|
|
}
|
|
|
|
func TestInt128Lsh(t *testing.T) {
|
|
for _, test := range lsh128Tests {
|
|
a := NewInt(test.a, 128)
|
|
r := New(128).Lsh(a, uint(test.b))
|
|
result := r.Text(16)
|
|
if result != test.r {
|
|
t.Errorf("TestInt128Lsh: got %v, expected %v", result, test.r)
|
|
}
|
|
}
|
|
}
|