Fix failing tests
Henner kein.regen@wolke7.net
Sat, 07 Oct 2017 17:53:50 +0200
1 files changed,
4 insertions(+),
0 deletions(-)
jump to
M
types_test.go
→
types_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() }