mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-16 13:50:54 +08:00
fix concurrent_test Error
This commit is contained in:
@@ -230,6 +230,7 @@ func TestConcurrentRemove(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//change t.Error remove->forEach
|
||||||
func TestConcurrentForEach(t *testing.T) {
|
func TestConcurrentForEach(t *testing.T) {
|
||||||
d := MakeConcurrent(0)
|
d := MakeConcurrent(0)
|
||||||
size := 100
|
size := 100
|
||||||
@@ -243,13 +244,13 @@ func TestConcurrentForEach(t *testing.T) {
|
|||||||
intVal, _ := value.(int)
|
intVal, _ := value.(int)
|
||||||
expectedKey := "k" + strconv.Itoa(intVal)
|
expectedKey := "k" + strconv.Itoa(intVal)
|
||||||
if key != expectedKey {
|
if key != expectedKey {
|
||||||
t.Error("remove test failed: expected " + expectedKey + ", actual: " + key)
|
t.Error("forEach test failed: expected " + expectedKey + ", actual: " + key)
|
||||||
}
|
}
|
||||||
i++
|
i++
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
if i != size {
|
if i != size {
|
||||||
t.Error("remove test failed: expected " + strconv.Itoa(size) + ", actual: " + strconv.Itoa(i))
|
t.Error("forEach test failed: expected " + strconv.Itoa(size) + ", actual: " + strconv.Itoa(i))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user