mirror of
https://github.com/nalgeon/redka.git
synced 2025-09-27 04:16:00 +08:00
24 lines
421 B
Go
24 lines
421 B
Go
package set
|
|
|
|
import (
|
|
"slices"
|
|
"sort"
|
|
"testing"
|
|
|
|
"github.com/nalgeon/redka/internal/core"
|
|
"github.com/nalgeon/redka/internal/redis"
|
|
"github.com/nalgeon/redka/internal/testx"
|
|
)
|
|
|
|
func getRedka(tb testing.TB) redis.Redka {
|
|
tb.Helper()
|
|
db := testx.OpenDB(tb)
|
|
return redis.RedkaDB(db)
|
|
}
|
|
|
|
func sortValues(vals []core.Value) {
|
|
sort.Slice(vals, func(i, j int) bool {
|
|
return slices.Compare(vals[i], vals[j]) < 0
|
|
})
|
|
}
|