diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-20 09:34:12 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-20 09:34:12 +0800 |
commit | 3983dd2428137211f84f299f9ce8690c22f50afd (patch) | |
tree | 3a2dc53b365e6f377fc82a3514150d1297fe549c /whisper/sort_test.go | |
parent | 7daa8c2f6eb25511c6a54ad420709af911fc6748 (diff) | |
parent | 0a9dc1536c5d776844d6947a0090ff7e1a7c6ab4 (diff) | |
download | go-tangerine-vv0.7.10.tar go-tangerine-vv0.7.10.tar.gz go-tangerine-vv0.7.10.tar.bz2 go-tangerine-vv0.7.10.tar.lz go-tangerine-vv0.7.10.tar.xz go-tangerine-vv0.7.10.tar.zst go-tangerine-vv0.7.10.zip |
Merge branch 'release/v0.7.10'vv0.7.10
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]) + } + } +} |