Commit 71a0f43d authored by Nick Craver's avatar Nick Craver

Tests: fix ScanResume

parent 77c690fe
...@@ -107,17 +107,19 @@ public void ScanResume() ...@@ -107,17 +107,19 @@ public void ScanResume()
var seq = server.Keys(DB, pageSize: 15); var seq = server.Keys(DB, pageSize: 15);
foreach (var key in seq) foreach (var key in seq)
{ {
i++;
if (i < 57) continue;
if (i == 57) if (i == 57)
{ {
snapCursor = ((IScanningCursor)seq).Cursor; snapCursor = ((IScanningCursor)seq).Cursor;
snapOffset = ((IScanningCursor)seq).PageOffset; snapOffset = ((IScanningCursor)seq).PageOffset;
snapPageSize = ((IScanningCursor)seq).PageSize; snapPageSize = ((IScanningCursor)seq).PageSize;
} }
expected.Add((string)key); if (i >= 57)
{
expected.Add((string)key);
}
i++;
} }
Assert.NotEqual(43, expected.Count); Assert.Equal(43, expected.Count);
Assert.NotEqual(0, snapCursor); Assert.NotEqual(0, snapCursor);
Assert.Equal(11, snapOffset); Assert.Equal(11, snapOffset);
Assert.Equal(15, snapPageSize); Assert.Equal(15, snapPageSize);
...@@ -155,7 +157,7 @@ public void ScanResume() ...@@ -155,7 +157,7 @@ public void ScanResume()
count++; count++;
} }
Assert.Empty(expected); Assert.Empty(expected);
Assert.Equal(44, count); // expect the initial item to be repeated Assert.Equal(43, count);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment