prysm-pulse/io/logs/stream_test.go
Raul Jordan a9a4bb9163
Move Shared/Testutil into Testing (#9659)
* move testutil

* util pkg

* build

* gaz

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-23 18:53:46 +00:00

24 lines
412 B
Go

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)
}