forked from TrueCloudLab/frostfs-node
Evgenii Stratonikov
d641cba2fc
Fix staticcheck warnings after go1.20 update. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
29 lines
477 B
Go
29 lines
477 B
Go
package client
|
|
|
|
import (
|
|
"math/rand"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestInitEndpoints(t *testing.T) {
|
|
r := rand.New(rand.NewSource(time.Now().UnixNano()))
|
|
|
|
ee := make([]Endpoint, 100)
|
|
for i := range ee {
|
|
ee[i].Priority = r.Int()
|
|
}
|
|
|
|
var eeInternal endpoints
|
|
eeInternal.init(ee)
|
|
|
|
prevValue := eeInternal.list[0].Priority
|
|
|
|
for _, e := range eeInternal.list {
|
|
require.True(t, prevValue <= e.Priority)
|
|
|
|
prevValue = e.Priority
|
|
}
|
|
}
|