-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package bot_test | ||
|
||
import ( | ||
"strings" | ||
"testing" | ||
|
||
"github.com/LucaBernstein/beancount-bot-tg/bot" | ||
"github.com/LucaBernstein/beancount-bot-tg/helpers" | ||
) | ||
|
||
func TestReplyKeyboardMaximumOptions(t *testing.T) { | ||
options := []string{"some", "few", "options"} | ||
reply := bot.ReplyKeyboard(options) | ||
helpers.TestExpect(t, len(reply.ReplyKeyboard), 3, "reply keyboard options count") | ||
|
||
options = strings.Split(strings.Repeat("more_options ", 50), " ") | ||
reply = bot.ReplyKeyboard(options) | ||
helpers.TestExpect(t, len(reply.ReplyKeyboard), helpers.MAX_REPLY_KEYBOARD_ENTRIES, "reply keyboard options count") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters