From 8cc3b9155ec66ff1087b74fd46e86923b24426ab Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Thu, 23 Jul 2020 18:40:32 +0100 Subject: [PATCH] Implement broadcast command test --- pkg/rove/command_test.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkg/rove/command_test.go b/pkg/rove/command_test.go index ec9c1b5..b0f2336 100644 --- a/pkg/rove/command_test.go +++ b/pkg/rove/command_test.go @@ -117,7 +117,18 @@ func TestCommand_Repair(t *testing.T) { } func TestCommand_Broadcast(t *testing.T) { - // TODO: Test the stash command + w := NewWorld(8) + name, err := w.SpawnRover() + assert.NoError(t, err) + + // Enqueue the broadcast and tick + err = w.Enqueue(name, &roveapi.Command{Command: roveapi.CommandType_broadcast, Broadcast: []byte("ABC")}) + assert.NoError(t, err) + w.Tick() + + info, err := w.GetRover(name) + assert.NoError(t, err) + assert.Contains(t, info.Logs[len(info.Logs)-1].Text, "ABC") } func TestCommand_Invalid(t *testing.T) {