Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
01e6a1ce
Commit
01e6a1ce
authored
Jul 06, 2018
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bad expectation in ScanResume
parent
31eedc47
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
Scans.cs
StackExchange.Redis.Tests/Scans.cs
+7
-2
No files found.
StackExchange.Redis.Tests/Scans.cs
View file @
01e6a1ce
...
...
@@ -94,7 +94,7 @@ public void ScanResume()
const
int
DB
=
7
;
// only goes up to 3.*, so...
Skip
.
IfMissingFeature
(
conn
,
"Avoiding Redis on Windows"
,
x
=>
x
.
Version
>=
new
Version
(
4
,
0
)
);
Skip
.
IfMissingFeature
(
conn
,
nameof
(
RedisFeatures
.
Scan
),
x
=>
x
.
Scan
);
var
db
=
conn
.
GetDatabase
(
DB
);
var
prefix
=
Me
();
var
server
=
GetServer
(
conn
);
...
...
@@ -129,9 +129,14 @@ public void ScanResume()
Output
.
WriteLine
(
$"Expected: 43, Actual:
{
expected
.
Count
}
, Cursor:
{
snapCursor
}
, Offset:
{
snapOffset
}
, PageSize:
{
snapPageSize
}
"
);
Assert
.
Equal
(
43
,
expected
.
Count
);
Assert
.
NotEqual
(
0
,
snapCursor
);
Assert
.
Equal
(
12
,
snapOffset
);
Assert
.
Equal
(
15
,
snapPageSize
);
// note: you might think that we can say "hmmm, 57 when using page-size 15 on an empty (flushed) db (so: no skipped keys); that'll be
// offset 12 in the 4th page; you'd be wrong, though; page size doesn't *actually* mean page size; it is a rough analogue for
// page size, with zero guarantees; in this particular test, the first page actually has 19 elements, for example. So: we cannot
// make the following assertion:
// Assert.Equal(12, snapOffset);
seq
=
server
.
Keys
(
DB
,
prefix
+
":*"
,
pageSize
:
15
,
cursor
:
snapCursor
,
pageOffset
:
snapOffset
);
var
seqCur
=
(
IScanningCursor
)
seq
;
Assert
.
Equal
(
snapCursor
,
seqCur
.
Cursor
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment