mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 18:24:12 +00:00
Adjust logger types (#3859)
This commit is contained in:
@@ -144,3 +144,18 @@ func TestCopyLineByLineSizeLimit(t *testing.T) {
|
||||
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
func TestStringReader(t *testing.T) {
|
||||
r := io.NopCloser(strings.NewReader("123\n4567\n890"))
|
||||
|
||||
testWriter := &testWriter{
|
||||
Mutex: &sync.Mutex{},
|
||||
writes: make([]string, 0),
|
||||
}
|
||||
|
||||
err := log.CopyLineByLine(testWriter, r, 1024)
|
||||
assert.NoError(t, err)
|
||||
|
||||
writes := testWriter.GetWrites()
|
||||
assert.Lenf(t, writes, 3, "expected 3 writes, got: %v", writes)
|
||||
}
|
||||
|
Reference in New Issue
Block a user