Bug fix : ZPOPMIN command.

Fixed the error caused by incorrect "boder" pass value.
And added a simple unit test to verify correctness.
This commit is contained in:
kaniu
2022-11-23 16:11:05 +08:00
committed by finley
parent febb83cb5c
commit 122d6ba505
2 changed files with 17 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
package sortedset
import "testing"
func TestSortedSet_PopMin(t *testing.T) {
var set = Make()
set.Add("s1", 1)
set.Add("s2", 2)
set.Add("s3", 3)
set.Add("s4", 4)
var results = set.PopMin(2)
if results[0].Member != "s1" || results[1].Member != "s2" {
t.Fail()
}
}