Skip to content

Commit

Permalink
fix unhandled errors in history tests
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Oct 7, 2024
1 parent 92d06f4 commit 9593de1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions history/history_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ func TestHistoryUndo(t *testing.T) {

buf := make([]byte, 8)
b, index, offset, cursor, tick = history.Undo()
b.Read(buf)
_, err := b.Read(buf)
if err != nil {
t.Errorf("err should be nil but got: %v", err)
}
if expected := "test1\x00\x00\x00"; string(buf) != expected {
t.Errorf("buf should be %q but got %q", expected, string(buf))
}
Expand All @@ -53,7 +56,10 @@ func TestHistoryUndo(t *testing.T) {

buf = make([]byte, 8)
b, offset, cursor, tick = history.Redo()
b.Read(buf)
_, err = b.Read(buf)
if err != nil {
t.Errorf("err should be nil but got: %v", err)
}
if expected := "test2\x00\x00\x00"; string(buf) != expected {
t.Errorf("buf should be %q but got %q", expected, string(buf))
}
Expand Down

0 comments on commit 9593de1

Please sign in to comment.