mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-16 05:40:49 +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) {
|
||||
d := MakeConcurrent(0)
|
||||
size := 100
|
||||
@@ -243,13 +244,13 @@ func TestConcurrentForEach(t *testing.T) {
|
||||
intVal, _ := value.(int)
|
||||
expectedKey := "k" + strconv.Itoa(intVal)
|
||||
if key != expectedKey {
|
||||
t.Error("remove test failed: expected " + expectedKey + ", actual: " + key)
|
||||
t.Error("forEach test failed: expected " + expectedKey + ", actual: " + key)
|
||||
}
|
||||
i++
|
||||
return true
|
||||
})
|
||||
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