X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/02cdaff8be27f37f44db8892bb12554f2d702323..153f3f9b4b09d521412eacca30eddeed395c3f41:/telegram_test.go diff --git a/telegram_test.go b/telegram_test.go index 2f944fa..a1a1ed2 100644 --- a/telegram_test.go +++ b/telegram_test.go @@ -22,7 +22,7 @@ func TestOwnerTalksToTheAgentThroughTelegram(t *testing.T) { telegram := newTelegramFake(t) bot, _ := telegramStartTestBot(t, telegram) socket := startTestDaemonWithBot(t, server, bot) - terminal := startTestClient(t, socket) + terminal := terminalStartTestClient(t, socket) terminal.WaitFor(t, "[connected to OneChat]") telegram.Add(TelegramUpdate{ @@ -44,7 +44,7 @@ func TestBotIgnoresEveryoneButTheOwner(t *testing.T) { telegram := newTelegramFake(t) bot, logs := telegramStartTestBot(t, telegram) socket := startTestDaemonWithBot(t, newModelFake(t), bot) - terminal := startTestClient(t, socket) + terminal := terminalStartTestClient(t, socket) terminal.WaitFor(t, "[connected to OneChat]") group := telegramOwnerMessage("secret in a group") @@ -150,7 +150,7 @@ func TestBotStartsAtTheStoredOffset(t *testing.T) { }) socket := startTestDaemonWithBot(t, server, bot) - terminal := startTestClient(t, socket) + terminal := terminalStartTestClient(t, socket) terminal.WaitFor(t, "[connected to OneChat]") telegramWaitForSent(t, telegram, "ok") @@ -237,7 +237,7 @@ func TestRepliesGoAsRichMessages(t *testing.T) { telegram := newTelegramFake(t) bot, _ := telegramStartTestBot(t, telegram) socket := startTestDaemonWithBot(t, server, bot) - terminal := startTestClient(t, socket) + terminal := terminalStartTestClient(t, socket) terminal.WaitFor(t, "[connected to OneChat]") terminal.Type("make **it** so") @@ -653,10 +653,10 @@ func TestLoadBotConfig(t *testing.T) { // telegramStartTestBot returns a bot of telegramTestOwner on server, with its // offset file in a temporary directory and short waits, and the buffer of its // log. -func telegramStartTestBot(t *testing.T, server *TelegramFake) (*TelegramBot, *syncBuffer) { +func telegramStartTestBot(t *testing.T, server *TelegramFake) (*TelegramBot, *SyncBuffer) { t.Helper() - logs := &syncBuffer{} + logs := &SyncBuffer{} bot := newTelegramBot(newTelegramAPI(server.URL, telegramTestToken), telegramTestOwner, filepath.Join(t.TempDir(), telegramOffsetFileName), log.New(logs, "", 0)) bot.minWait = time.Millisecond bot.maxWait = 10 * time.Millisecond