summaryrefslogtreecommitdiff
path: root/error_buffer_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'error_buffer_test.go')
-rw-r--r--error_buffer_test.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/error_buffer_test.go b/error_buffer_test.go
index 09ea4f03..81107935 100644
--- a/error_buffer_test.go
+++ b/error_buffer_test.go
@@ -30,8 +30,7 @@ func TestErrBuffer_Write_Event(t *testing.T) {
<-tr
// messages are read
- assert.Equal(t, 6, buf.Len())
- assert.Equal(t, "hello\n", buf.String())
+ assert.Equal(t, 0, buf.Len())
}
func TestErrBuffer_Write_Event_Separated(t *testing.T) {
@@ -50,6 +49,18 @@ func TestErrBuffer_Write_Event_Separated(t *testing.T) {
buf.Write([]byte("ending"))
<-tr
+ assert.Equal(t, 0, buf.Len())
+ assert.Equal(t, "", buf.String())
+}
+
+func TestErrBuffer_Write_Event_Separated_NoListener(t *testing.T) {
+ buf := newErrBuffer()
+ defer buf.Close()
+
+ buf.Write([]byte("hel"))
+ buf.Write([]byte("lo\n"))
+ buf.Write([]byte("ending"))
+
assert.Equal(t, 12, buf.Len())
assert.Equal(t, "hello\nending", buf.String())
}