raft: fixed some typos and simplify minor logic

This commit is contained in:
Wine93
2019-08-23 01:44:49 +00:00
parent f4dfd1976d
commit 5f42161750
3 changed files with 8 additions and 8 deletions

View File

@ -265,7 +265,7 @@ func TestLogMaybeAppend(t *testing.T) {
t.Fatalf("unexpected error %v", err)
}
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)
}
}
}()
@ -671,13 +671,13 @@ func TestIsOutOfBounds(t *testing.T) {
}()
err := l.mustCheckOutOfBounds(tt.lo, tt.hi)
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 {
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 {
t.Errorf("%d: unexpected err %v", i, err)
t.Errorf("#%d: unexpected err %v", i, err)
}
}()
}