prysm-pulse/io/logs/stream_test.go

24 lines
415 B
Go
Raw Permalink Normal View History

package logs
import (
"testing"
"github.com/prysmaticlabs/prysm/v5/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)
}