all repos — telegram-bot-api @ c697a95948b08fd61419986d493601d14f3b3744

Golang bindings for the Telegram Bot API

Fix failing tests
Henner kein.regen@wolke7.net
Sat, 07 Oct 2017 17:53:50 +0200
commit

c697a95948b08fd61419986d493601d14f3b3744

parent

5f5f94047c7a2f67e0d19bd5f1012321a0579e8a

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M types_test.gotypes_test.go

@@ -34,6 +34,7 @@ }

func TestMessageIsCommandWithCommand(t *testing.T) { message := tgbotapi.Message{Text: "/command"} + message.Entities = &[]tgbotapi.MessageEntity{{Type: "bot_command", Offset: 0, Length: 8}} if message.IsCommand() != true { t.Fail()

@@ -58,6 +59,7 @@ }

func TestCommandWithCommand(t *testing.T) { message := tgbotapi.Message{Text: "/command"} + message.Entities = &[]tgbotapi.MessageEntity{{Type: "bot_command", Offset: 0, Length: 8}} if message.Command() != "command" { t.Fail()

@@ -82,6 +84,7 @@ }

func TestCommandWithBotName(t *testing.T) { message := tgbotapi.Message{Text: "/command@testbot"} + message.Entities = &[]tgbotapi.MessageEntity{{Type: "bot_command", Offset: 0, Length: 16}} if message.Command() != "command" { t.Fail()

@@ -90,6 +93,7 @@ }

func TestMessageCommandArgumentsWithArguments(t *testing.T) { message := tgbotapi.Message{Text: "/command with arguments"} + message.Entities = &[]tgbotapi.MessageEntity{{Type: "bot_command", Offset: 0, Length: 8}} if message.CommandArguments() != "with arguments" { t.Fail() }