|
@@ -265,7 +265,7 @@ func TestLogMaybeAppend(t *testing.T) {
|
|
|
t.Fatalf("unexpected error %v", err)
|
|
t.Fatalf("unexpected error %v", err)
|
|
|
}
|
|
}
|
|
|
if !reflect.DeepEqual(tt.ents, gents) {
|
|
if !reflect.DeepEqual(tt.ents, gents) {
|
|
|
- t.Errorf("%d: appended entries = %v, want %v", i, gents, tt.ents)
|
|
|
|
|
|
|
+ t.Errorf("#%d: appended entries = %v, want %v", i, gents, tt.ents)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}()
|
|
}()
|
|
@@ -426,7 +426,7 @@ func TestUnstableEnts(t *testing.T) {
|
|
|
|
|
|
|
|
ents := raftLog.unstableEntries()
|
|
ents := raftLog.unstableEntries()
|
|
|
if l := len(ents); l > 0 {
|
|
if l := len(ents); l > 0 {
|
|
|
- raftLog.stableTo(ents[l-1].Index, ents[l-i].Term)
|
|
|
|
|
|
|
+ raftLog.stableTo(ents[l-1].Index, ents[l-1].Term)
|
|
|
}
|
|
}
|
|
|
if !reflect.DeepEqual(ents, tt.wents) {
|
|
if !reflect.DeepEqual(ents, tt.wents) {
|
|
|
t.Errorf("#%d: unstableEnts = %+v, want %+v", i, ents, tt.wents)
|
|
t.Errorf("#%d: unstableEnts = %+v, want %+v", i, ents, tt.wents)
|
|
@@ -671,13 +671,13 @@ func TestIsOutOfBounds(t *testing.T) {
|
|
|
}()
|
|
}()
|
|
|
err := l.mustCheckOutOfBounds(tt.lo, tt.hi)
|
|
err := l.mustCheckOutOfBounds(tt.lo, tt.hi)
|
|
|
if tt.wpanic {
|
|
if tt.wpanic {
|
|
|
- t.Errorf("%d: panic = %v, want %v", i, false, true)
|
|
|
|
|
|
|
+ t.Errorf("#%d: panic = %v, want %v", i, false, true)
|
|
|
}
|
|
}
|
|
|
if tt.wErrCompacted && err != ErrCompacted {
|
|
if tt.wErrCompacted && err != ErrCompacted {
|
|
|
- t.Errorf("%d: err = %v, want %v", i, err, ErrCompacted)
|
|
|
|
|
|
|
+ t.Errorf("#%d: err = %v, want %v", i, err, ErrCompacted)
|
|
|
}
|
|
}
|
|
|
if !tt.wErrCompacted && err != nil {
|
|
if !tt.wErrCompacted && err != nil {
|
|
|
- t.Errorf("%d: unexpected err %v", i, err)
|
|
|
|
|
|
|
+ t.Errorf("#%d: unexpected err %v", i, err)
|
|
|
}
|
|
}
|
|
|
}()
|
|
}()
|
|
|
}
|
|
}
|