Skip to content

Commit

Permalink
wrap long lines in buffer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Oct 18, 2024
1 parent 683d461 commit c75a332
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions buffer/buffer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,16 @@ func TestBufferCopy(t *testing.T) {
p := make([]byte, 17)
_, _ = got.Read(p)
if !strings.HasPrefix(string(p), testCase.expected+"\x00") {
t.Errorf("Copy(%d, %d) should clone %q but got %q", testCase.start, testCase.end, testCase.expected, string(p))
t.Errorf("Copy(%d, %d) should clone %q but got %q",
testCase.start, testCase.end, testCase.expected, string(p))
}
got.Insert(0, 0x48)
got.Insert(int64(len(testCase.expected)+1), 0x49)
p = make([]byte, 19)
_, _ = got.ReadAt(p, 0)
if !strings.HasPrefix(string(p), "H"+testCase.expected+"I\x00") {
t.Errorf("Copy(%d, %d) should clone %q but got %q", testCase.start, testCase.end, testCase.expected, string(p))
t.Errorf("Copy(%d, %d) should clone %q but got %q",
testCase.start, testCase.end, testCase.expected, string(p))
}
}
}
Expand Down Expand Up @@ -274,14 +276,16 @@ func TestBufferCut(t *testing.T) {
p := make([]byte, 17)
_, _ = got.Read(p)
if !strings.HasPrefix(string(p), testCase.expected+"\x00") {
t.Errorf("Cut(%d, %d) should result into %q but got %q", testCase.start, testCase.end, testCase.expected, string(p))
t.Errorf("Cut(%d, %d) should result into %q but got %q",
testCase.start, testCase.end, testCase.expected, string(p))
}
got.Insert(0, 0x48)
got.Insert(int64(len(testCase.expected)+1), 0x49)
p = make([]byte, 19)
_, _ = got.ReadAt(p, 0)
if !strings.HasPrefix(string(p), "H"+testCase.expected+"I\x00") {
t.Errorf("Cut(%d, %d) should result into %q but got %q", testCase.start, testCase.end, testCase.expected, string(p))
t.Errorf("Cut(%d, %d) should result into %q but got %q",
testCase.start, testCase.end, testCase.expected, string(p))
}
}
}
Expand Down

0 comments on commit c75a332

Please sign in to comment.