mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-06 01:07:06 +08:00

Fixed the error caused by incorrect "boder" pass value. And added a simple unit test to verify correctness.
17 lines
276 B
Go
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()
|
|
}
|
|
}
|