types: use mod 3 and mod 7 for test

This commit is contained in:
c9s 2022-01-13 10:59:03 +08:00
parent e573c18a5c
commit e91dc5a518

View File

@ -183,7 +183,7 @@ func TestRBTree_bulkInsertAndDelete(t *testing.T) {
tree.Upsert(price, volume)
pvs[price] = volume
if i%3 == 0 || i%2 == 0 {
if i%3 == 0 || i%7 == 0 {
removePrice := getRandomPrice()
if removePrice > 0 {
if !assert.True(t, tree.Delete(removePrice), "existing price %f should be removed at round %d", removePrice.Float64(), i) {
@ -194,6 +194,7 @@ func TestRBTree_bulkInsertAndDelete(t *testing.T) {
}
}
// all prices should be found
for p := range pvs {
node := tree.Search(p)
if !assert.NotNil(t, node, "should found price %f", p.Float64()) {