Skip to content

Commit 51c54e4

Browse files
committed
test
1 parent 9874855 commit 51c54e4

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

src/test/java/com/moilioncircle/redis/rdb/cli/ext/rct/FormatterRdbVisitorTest.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,29 @@ public void before() {
3434
public void test() throws Exception {
3535
String source = path("dumpV8.rdb");
3636
String target = path("dumpV8-result.txt");
37-
String expect = path("dumpV8-expect.txt");
3837

3938
// rct -f test -s ./dumpV8.rdb -o dumpV8-result.txt -e json
4039
RctCommand.run(new String[]{"-f", "test", "-s", source, "-o", target, "-e", "json"});
41-
assertArrayEquals(Files.readAllBytes(new File(expect).toPath()), Files.readAllBytes(new File(target).toPath()));
40+
assertArrayEquals(expect(), Files.readAllBytes(new File(target).toPath()));
41+
}
42+
43+
private byte[] expect() {
44+
String v = "key2,there\n" +
45+
"key1,Hello\n" +
46+
"mset1,hello\n" +
47+
"set,value\n" +
48+
"bitfield,\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0001\\u0000\n" +
49+
"bitopdest,`bc\\u0000\\u0000\\u0000\n" +
50+
"append,value\n" +
51+
"esss,value\n" +
52+
"bitop2,abcdef\n" +
53+
"decrby,5\n" +
54+
"mset2,world\n" +
55+
"exxx,value\n" +
56+
"getset,0\n" +
57+
"mykey3,Hello\n" +
58+
"incrby,16\n" +
59+
"bitop1,foo\n";
60+
return v.getBytes();
4261
}
4362
}

src/test/resources/dumpV8-expect.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)