MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / testZSetRange

Function testZSetRange

sorted_sets_test.go:205–226  ·  view source on GitHub ↗
(ay []interface{}, checkValues ...interface{})

Source from the content-addressed store, hash-verified

203}
204
205func testZSetRange(ay []interface{}, checkValues ...interface{}) error {
206 if len(ay) != len(checkValues) {
207 return fmt.Errorf("invalid return number %d != %d", len(ay), len(checkValues))
208 }
209
210 for i := 0; i < len(ay); i++ {
211 switch cv := checkValues[i].(type) {
212 case string:
213 v := cast.ToString(ay[i])
214 if v != cv {
215 return fmt.Errorf("not equal %s != %s", v, checkValues[i])
216 }
217 default:
218 if s, _ := cast.ToIntE(ay[i]); s != checkValues[i] {
219 return fmt.Errorf("not equal %v != %v", s, checkValues[i])
220 }
221 }
222
223 }
224
225 return nil
226}
227
228func TestZSetRangeScore(t *testing.T) {
229 c := getTestConn()

Callers 2

TestZSetRangeScoreFunction · 0.85
TestZSetRangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected