(t *testing.T)
| 915 | |
| 916 | } |
| 917 | func TestZSetStructure_adjustMinMax(t *testing.T) { |
| 918 | zss, _ := NewZSetStructure(config.DefaultOptions) |
| 919 | fz := newZSetNodes() |
| 920 | |
| 921 | _, _, err := zss.adjustMinMax(fz, 100, 0) |
| 922 | assert.Equal(t, ErrInvalidArgs, err) |
| 923 | // |
| 924 | _ = fz.InsertNode(30, "mem1", "") |
| 925 | _ = fz.InsertNode(200, "mem1", "") |
| 926 | minScore, maxScore, err := zss.adjustMinMax(fz, 10, 50) |
| 927 | assert.NoError(t, err) |
| 928 | // as the min now is 30, our provided min of 10 will be turned into 30 |
| 929 | // as our param of max is 50 and maximum score is 200, it won't change |
| 930 | assert.Equal(t, 30, minScore) |
| 931 | assert.Equal(t, 50, maxScore) |
| 932 | } |
| 933 | |
| 934 | func TestZset_getNodeByRank(t *testing.T) { |
| 935 | sl := newSkipList() |
nothing calls this directly
no test coverage detected