(gid int, tg *TestGroup, tags *ZeroTags)
| 46 | } |
| 47 | |
| 48 | func (tc *TestListTestCase) player(gid int, tg *TestGroup, tags *ZeroTags) { |
| 49 | tg.PlayerWait() |
| 50 | defer tg.PlayerDone() |
| 51 | c := NewConn(tc.proxy) |
| 52 | defer c.Close() |
| 53 | us := UnitSlice(make([]*Unit, tc.nkeys)) |
| 54 | for i := 0; i < len(us); i++ { |
| 55 | key := fmt.Sprintf("test_list_%d_%d_tag{%s}", gid, i, tags.Get(i)) |
| 56 | us[i] = NewUnit(key) |
| 57 | } |
| 58 | for _, u := range us { |
| 59 | u.Del(c, false) |
| 60 | ops.Incr() |
| 61 | } |
| 62 | for i := 0; i < tc.round; i++ { |
| 63 | r := &Rand{time.Now().UnixNano()} |
| 64 | for j := 0; j < tc.nvals; j++ { |
| 65 | for _, u := range us { |
| 66 | u.Lpush(c, "val_"+strconv.Itoa(r.Next())) |
| 67 | ops.Incr() |
| 68 | } |
| 69 | } |
| 70 | for j := 0; j < tc.nvals; j++ { |
| 71 | for _, u := range us { |
| 72 | u.Lpop(c) |
| 73 | ops.Incr() |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | for _, u := range us { |
| 78 | u.Del(c, false) |
| 79 | ops.Incr() |
| 80 | } |
| 81 | } |
no test coverage detected