forked from TrueCloudLab/frostfs-node
[#688] pkg/ir/governance: Add unsorted
test case
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
bb3f16d487
commit
c20eb15bd5
1 changed files with 13 additions and 0 deletions
|
@ -55,6 +55,19 @@ func TestNewAlphabetList(t *testing.T) {
|
|||
require.True(t, equalPublicKeyLists(list, rounds[i]))
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("unsorted keys", func(t *testing.T) {
|
||||
orig := keys.PublicKeys{k[1], k[2], k[3], k[4]}
|
||||
main := keys.PublicKeys{k[1], k[2], k[5], k[4]}
|
||||
|
||||
exp := make(keys.PublicKeys, len(main))
|
||||
copy(exp, main)
|
||||
sort.Sort(exp)
|
||||
|
||||
got, err := newAlphabetList(orig, main)
|
||||
require.NoError(t, err)
|
||||
require.True(t, equalPublicKeyLists(exp, got)) // expect {1, 2, 4, 5}, not {1, 2, 3, 5}
|
||||
})
|
||||
}
|
||||
|
||||
func TestUpdateInnerRing(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue