MCPcopy Index your code
hub / github.com/CodisLabs/codis / main

Method main

extern/deprecated/redis-test/test_string.go:26–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26func (tc *TestStringTestCase) main() {
27 c := NewConn(tc.proxy)
28 defer c.Close()
29 u := NewUnit(fmt.Sprintf("test_string_tag{%s}", NewZeroTag()))
30 u.Del(c, false)
31 r := &Rand{time.Now().UnixNano()}
32 n := 0
33 if step := tc.maxlen / 1000; step != 0 {
34 buf := make([]byte, step)
35 for i := 0; i < 1000; i++ {
36 for j := 0; j < step; j++ {
37 buf[j] = byte(uint64(r.Next())%(127-32) + 32)
38 }
39 u.Append(c, string(buf))
40 u.GetString(c)
41 n += step
42 ops.Incr()
43 }
44 }
45 for ; n < tc.maxlen; n++ {
46 u.Append(c, string(byte(uint64(r.Next())%(127-32)+32)))
47 u.GetString(c)
48 ops.Incr()
49 }
50 u.Del(c, true)
51 fmt.Println("done")
52}

Callers

nothing calls this directly

Calls 10

CloseMethod · 0.95
DelMethod · 0.95
NextMethod · 0.95
AppendMethod · 0.95
GetStringMethod · 0.95
NewUnitFunction · 0.85
NewZeroTagFunction · 0.85
PrintlnMethod · 0.80
NewConnFunction · 0.70
IncrMethod · 0.45

Tested by

no test coverage detected