Parcourir la source

raft: add a test case for Test Slice

Xiang Li il y a 9 ans
Parent
commit
9423125ce1
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      raft/log_test.go

+ 1 - 0
raft/log_test.go

@@ -782,6 +782,7 @@ func TestSlice(t *testing.T) {
 		// test limit
 		{half - 1, half + 1, 0, []pb.Entry{{Index: half - 1, Term: half - 1}}, false},
 		{half - 1, half + 1, uint64(halfe.Size() + 1), []pb.Entry{{Index: half - 1, Term: half - 1}}, false},
+		{half - 2, half + 1, uint64(halfe.Size() + 1), []pb.Entry{{Index: half - 2, Term: half - 2}}, false},
 		{half - 1, half + 1, uint64(halfe.Size() * 2), []pb.Entry{{Index: half - 1, Term: half - 1}, {Index: half, Term: half}}, false},
 		{half - 1, half + 2, uint64(halfe.Size() * 3), []pb.Entry{{Index: half - 1, Term: half - 1}, {Index: half, Term: half}, {Index: half + 1, Term: half + 1}}, false},
 		{half, half + 2, uint64(halfe.Size()), []pb.Entry{{Index: half, Term: half}}, false},