| 1 | // Copyright (c) 2021 Uber Technologies, Inc. |
| 2 | // |
| 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy |
| 4 | // of this software and associated documentation files (the "Software"), to deal |
| 5 | // in the Software without restriction, including without limitation the rights |
| 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 7 | // copies of the Software, and to permit persons to whom the Software is |
| 8 | // furnished to do so, subject to the following conditions: |
| 9 | // |
| 10 | // The above copyright notice and this permission notice shall be included in |
| 11 | // all copies or substantial portions of the Software. |
| 12 | // |
| 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 19 | // THE SOFTWARE. |
| 20 | |
| 21 | package zapcorescip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/ |
| 22 | |
| 23 | import ( |
| 24 | "bytesscip-go gomod github.com/golang/go/src go1.19 bytes/" |
| 25 | "testingscip-go gomod github.com/golang/go/src go1.19 testing/" |
| 26 | "timescip-go gomod github.com/golang/go/src go1.19 time/" |
| 27 | |
| 28 | "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/" |
| 29 | "github.com/stretchr/testify/requirescip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/require`/" |
| 30 | "go.uber.org/zap/internal/ztestscip-go gomod go.uber.org/zap . `go.uber.org/zap/internal/ztest`/" |
| 31 | ) |
| 32 | |
| 33 | func TestBufferWriterscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/TestBufferWriter().(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) { |
| 34 | // If we pass a plain io.Writer, make sure that we still get a WriteSyncer |
| 35 | // with a no-op Sync. |
| 36 | t.Runscip-go gomod github.com/golang/go/src go1.19 testing/T#Run().("sync", func(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) { |
| 37 | buf := &bytesscip-go gomod github.com/golang/go/src go1.19 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#{} |
| 38 | ws := &BufferedWriteSyncerscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#{WSscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#WS.: AddSyncscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/AddSync().(buf)} |
| 39 | |
| 40 | requireWriteWorksscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/requireWriteWorks().(t, ws) |
| 41 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Emptyscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Empty().(t, buf.Stringscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#String().(), "Unexpected log calling a no-op Write method.") |
| 42 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/NoError().(t, ws.Syncscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Sync().(), "Unexpected error calling a no-op Sync method.") |
| 43 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Equal().(t, "foo", buf.Stringscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#String().(), "Unexpected log string") |
| 44 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/NoError().(t, ws.Stopscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Stop().()) |
| 45 | }) |
| 46 | |
| 47 | t.Runscip-go gomod github.com/golang/go/src go1.19 testing/T#Run().("stop", func(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) { |
| 48 | buf := &bytesscip-go gomod github.com/golang/go/src go1.19 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#{} |
| 49 | ws := &BufferedWriteSyncerscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#{WSscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#WS.: AddSyncscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/AddSync().(buf)} |
| 50 | requireWriteWorksscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/requireWriteWorks().(t, ws) |
| 51 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Emptyscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Empty().(t, buf.Stringscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#String().(), "Unexpected log calling a no-op Write method.") |
| 52 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/NoError().(t, ws.Stopscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Stop().()) |
| 53 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Equal().(t, "foo", buf.Stringscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#String().(), "Unexpected log string") |
| 54 | }) |
| 55 | |
| 56 | t.Runscip-go gomod github.com/golang/go/src go1.19 testing/T#Run().("stop twice", func(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) { |
| 57 | ws := &BufferedWriteSyncerscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#{WSscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#WS.: &ztestscip-go gomod go.uber.org/zap . `go.uber.org/zap/internal/ztest`/.FailWriterscip-go gomod go.uber.org/zap . `go.uber.org/zap/internal/ztest`/FailWriter#{}} |
| 58 | _, err := ws.Writescip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Write().([]byte("foo")) |
| 59 | requirescip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/require`/NoError().(t, err, "Unexpected error writing to WriteSyncer.") |
| 60 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Errorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Error().(t, ws.Stopscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Stop().(), "Expected stop to fail.") |
| 61 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/NoError().(t, ws.Stopscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Stop().(), "Expected stop to not fail.") |
| 62 | }) |
| 63 | |
| 64 | t.Runscip-go gomod github.com/golang/go/src go1.19 testing/T#Run().("wrap twice", func(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) { |
| 65 | buf := &bytesscip-go gomod github.com/golang/go/src go1.19 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#{} |
| 66 | bufsync := &BufferedWriteSyncerscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#{WSscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#WS.: AddSyncscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/AddSync().(buf)} |
| 67 | ws := &BufferedWriteSyncerscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#{WSscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#WS.: bufsync} |
| 68 | requireWriteWorksscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/requireWriteWorks().(t, ws) |
| 69 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Emptyscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Empty().(t, buf.Stringscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#String().(), "Unexpected log calling a no-op Write method.") |
| 70 | requirescip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/require`/NoError().(t, ws.Syncscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Sync().()) |
| 71 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Equal().(t, "foo", buf.Stringscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#String().()) |
| 72 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/NoError().(t, ws.Stopscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Stop().()) |
| 73 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/NoError().(t, bufsync.Stopscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Stop().()) |
| 74 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Equal().(t, "foo", buf.Stringscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#String().(), "Unexpected log string") |
| 75 | }) |
| 76 | |
| 77 | t.Runscip-go gomod github.com/golang/go/src go1.19 testing/T#Run().("small buffer", func(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) { |
| 78 | buf := &bytesscip-go gomod github.com/golang/go/src go1.19 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#{} |
| 79 | ws := &BufferedWriteSyncerscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#{WSscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#WS.: AddSyncscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/AddSync().(buf), Sizescip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Size.: 5} |
| 80 | |
| 81 | requireWriteWorksscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/requireWriteWorks().(t, ws) |
| 82 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Equal().(t, "", buf.Stringscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#String().(), "Unexpected log calling a no-op Write method.") |
| 83 | requireWriteWorksscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/requireWriteWorks().(t, ws) |
| 84 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Equal().(t, "foo", buf.Stringscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#String().(), "Unexpected log string") |
| 85 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/NoError().(t, ws.Stopscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Stop().()) |
| 86 | }) |
| 87 | |
| 88 | t.Runscip-go gomod github.com/golang/go/src go1.19 testing/T#Run().("with lockedWriteSyncer", func(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) { |
| 89 | buf := &bytesscip-go gomod github.com/golang/go/src go1.19 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#{} |
| 90 | ws := &BufferedWriteSyncerscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#{WSscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#WS.: Lockscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/Lock().(AddSyncscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/AddSync().(buf)), Sizescip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Size.: 5} |
| 91 | |
| 92 | requireWriteWorksscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/requireWriteWorks().(t, ws) |
| 93 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Equal().(t, "", buf.Stringscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#String().(), "Unexpected log calling a no-op Write method.") |
| 94 | requireWriteWorksscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/requireWriteWorks().(t, ws) |
| 95 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Equal().(t, "foo", buf.Stringscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#String().(), "Unexpected log string") |
| 96 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/NoError().(t, ws.Stopscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Stop().()) |
| 97 | }) |
| 98 | |
| 99 | t.Runscip-go gomod github.com/golang/go/src go1.19 testing/T#Run().("flush error", func(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) { |
| 100 | ws := &BufferedWriteSyncerscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#{WSscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#WS.: &ztestscip-go gomod go.uber.org/zap . `go.uber.org/zap/internal/ztest`/.FailWriterscip-go gomod go.uber.org/zap . `go.uber.org/zap/internal/ztest`/FailWriter#{}, Sizescip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Size.: 4} |
| 101 | n, err := ws.Writescip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Write().([]byte("foo")) |
| 102 | requirescip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/require`/NoError().(t, err, "Unexpected error writing to WriteSyncer.") |
| 103 | requirescip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/require`/.Equalscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/require`/Equal().(t, 3, n, "Wrote an unexpected number of bytes.") |
| 104 | _, err = ws.Writescip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Write().([]byte("foo")) |
| 105 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Errorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Error().(t, err, "Expected error writing to WriteSyncer.") |
| 106 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Errorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Error().(t, ws.Stopscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Stop().(), "Expected stop to fail.") |
| 107 | }) |
| 108 | |
| 109 | t.Runscip-go gomod github.com/golang/go/src go1.19 testing/T#Run().("flush timer", func(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) { |
| 110 | buf := &bytesscip-go gomod github.com/golang/go/src go1.19 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#{} |
| 111 | clock := ztestscip-go gomod go.uber.org/zap . `go.uber.org/zap/internal/ztest`/.NewMockClockscip-go gomod go.uber.org/zap . `go.uber.org/zap/internal/ztest`/NewMockClock().() |
| 112 | ws := &BufferedWriteSyncerscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#{ |
| 113 | WSscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#WS.: AddSyncscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/AddSync().(buf), |
| 114 | Sizescip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Size.: 6, |
| 115 | FlushIntervalscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#FlushInterval.: timescip-go gomod github.com/golang/go/src go1.19 time/.Microsecondscip-go gomod github.com/golang/go/src go1.19 time/Microsecond., |
| 116 | Clockscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Clock.: clock, |
| 117 | } |
| 118 | requireWriteWorksscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/requireWriteWorks().(t, ws) |
| 119 | clock.Addscip-go gomod go.uber.org/zap . `go.uber.org/zap/internal/ztest`/MockClock#Add().(10 * timescip-go gomod github.com/golang/go/src go1.19 time/.Microsecondscip-go gomod github.com/golang/go/src go1.19 time/Microsecond.) |
| 120 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Equal().(t, "foo", buf.Stringscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#String().(), "Unexpected log string") |
| 121 | |
| 122 | // flush twice to validate loop logic |
| 123 | requireWriteWorksscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/requireWriteWorks().(t, ws) |
| 124 | clock.Addscip-go gomod go.uber.org/zap . `go.uber.org/zap/internal/ztest`/MockClock#Add().(10 * timescip-go gomod github.com/golang/go/src go1.19 time/.Microsecondscip-go gomod github.com/golang/go/src go1.19 time/Microsecond.) |
| 125 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/Equal().(t, "foofoo", buf.Stringscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#String().(), "Unexpected log string") |
| 126 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/NoError().(t, ws.Stopscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Stop().()) |
| 127 | }) |
| 128 | } |
| 129 | |
| 130 | func TestBufferWriterWithoutStartscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/TestBufferWriterWithoutStart().(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) { |
| 131 | t.Runscip-go gomod github.com/golang/go/src go1.19 testing/T#Run().("stop", func(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) { |
| 132 | ws := &BufferedWriteSyncerscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#{WSscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#WS.: AddSyncscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/AddSync().(new(bytesscip-go gomod github.com/golang/go/src go1.19 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#))} |
| 133 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/NoError().(t, ws.Stopscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Stop().(), "Stop must not fail") |
| 134 | }) |
| 135 | |
| 136 | t.Runscip-go gomod github.com/golang/go/src go1.19 testing/T#Run().("Sync", func(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) { |
| 137 | ws := &BufferedWriteSyncerscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#{WSscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#WS.: AddSyncscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/AddSync().(new(bytesscip-go gomod github.com/golang/go/src go1.19 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.19 bytes/Buffer#))} |
| 138 | assertscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.1 `github.com/stretchr/testify/assert`/NoError().(t, ws.Syncscip-go gomod go.uber.org/zap . `go.uber.org/zap/zapcore`/BufferedWriteSyncer#Sync().(), "Sync must not fail") |
| 139 | }) |
| 140 | } |