prysm-pulse/io/logs/stream_test.go

24 lines
412 B
Go
Raw Normal View History

package logs
import (
"testing"
"github.com/prysmaticlabs/prysm/testing/require"
)
func TestStreamServer_BackfillsMessages(t *testing.T) {
ss := NewStreamServer()
msgs := [][]byte{
[]byte("foo"),
[]byte("bar"),
[]byte("buzz"),
}
for _, msg := range msgs {
_, err := ss.Write(msg)
require.NoError(t, err)
}
recentMessages := ss.GetLastFewLogs()
require.DeepEqual(t, msgs, recentMessages)
}