-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* support slotinfo 244 Signed-off-by: catcherwong <[email protected]> * fix slot info Signed-off-by: catcherwong <[email protected]> * remove useless code Signed-off-by: catcherwong <[email protected]> --------- Signed-off-by: catcherwong <[email protected]>
- Loading branch information
1 parent
702d263
commit 8a8ab76
Showing
5 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using RDBParser; | ||
using System.Text; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace RDBParserTests | ||
{ | ||
public class ClusterTests | ||
{ | ||
private ITestOutputHelper _output; | ||
|
||
public ClusterTests(ITestOutputHelper output) | ||
{ | ||
this._output = output; | ||
} | ||
|
||
[Fact] | ||
public void TestSoltInfo() | ||
{ | ||
// set key{v1} v1 | ||
// set key{v12} v12 | ||
// bgsave | ||
var path = TestHelper.GetRDBPath("redis74_cluster_slotinfo.rdb"); | ||
|
||
var callback = new TestReaderCallback(_output); | ||
var parser = new BinaryReaderRDBParser(callback); | ||
parser.Parse(path); | ||
|
||
var infos = callback.GetInfos(); | ||
|
||
Assert.Equal(1165, (int)infos[0][Encoding.UTF8.GetBytes("key{v1}")].SlotId); | ||
Assert.Equal(2589, (int)infos[0][Encoding.UTF8.GetBytes("key{v12}")].SlotId); | ||
} | ||
} | ||
} |
Binary file not shown.