mirror of https://github.com/ethereum/go-ethereum
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
331 B
23 lines
331 B
package whisper
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
)
|
|
|
|
func TestSorting(t *testing.T) {
|
|
m := map[int32]common.Hash{
|
|
1: {1},
|
|
3: {3},
|
|
2: {2},
|
|
5: {5},
|
|
}
|
|
exp := []int32{1, 2, 3, 5}
|
|
res := sortKeys(m)
|
|
for i, k := range res {
|
|
if k != exp[i] {
|
|
t.Error(k, "failed. Expected", exp[i])
|
|
}
|
|
}
|
|
}
|
|
|