diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-08 19:43:33 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-08 19:43:33 +0800 |
commit | ebe2d9d872c5482e02508f1d3e9c3a56e8a41d44 (patch) | |
tree | c26c4e780226851bc699ca182bcb2f4d5da3dc0e /whisper/sort_test.go | |
parent | f06543fd066e11ac5c36f3eba4f1f82a7a1aefb8 (diff) | |
download | dexon-ebe2d9d872c5482e02508f1d3e9c3a56e8a41d44.tar.gz dexon-ebe2d9d872c5482e02508f1d3e9c3a56e8a41d44.tar.zst dexon-ebe2d9d872c5482e02508f1d3e9c3a56e8a41d44.zip |
First draft of Whisper messages relaying
Diffstat (limited to 'whisper/sort_test.go')
-rw-r--r-- | whisper/sort_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/whisper/sort_test.go b/whisper/sort_test.go new file mode 100644 index 000000000..5d8177d41 --- /dev/null +++ b/whisper/sort_test.go @@ -0,0 +1,19 @@ +package whisper + +import "testing" + +func TestSorting(t *testing.T) { + m := map[int32]Hash{ + 1: HS("1"), + 3: HS("3"), + 2: HS("2"), + 5: HS("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]) + } + } +} |