Files
redis-go/datastruct/sortedset/sortedset_test.go
kaniu 122d6ba505 Bug fix : ZPOPMIN command.
Fixed the error caused by incorrect "boder" pass value.
And added a simple unit test to verify correctness.
2022-11-24 13:55:04 +08:00

17 lines
276 B
Go

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()
}
}