Add more tests.
This commit is contained in:
parent
289f7ef6ad
commit
c0eb5db6c3
4 changed files with 131 additions and 0 deletions
|
@ -108,6 +108,22 @@ func TestMessageCommandArgumentsForNonCommand(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestMessageEntityParseURLGood(t *testing.T) {
|
||||
entity := tgbotapi.MessageEntity{URL: "https://www.google.com"}
|
||||
|
||||
if _, err := entity.ParseURL(); err != nil {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestMessageEntityParseURLBad(t *testing.T) {
|
||||
entity := tgbotapi.MessageEntity{URL: ""}
|
||||
|
||||
if _, err := entity.ParseURL(); err == nil {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestChatIsPrivate(t *testing.T) {
|
||||
chat := tgbotapi.Chat{ID: 10, Type: "private"}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue