(new): rich message support
Golang lint / lint (pull_request) Successful in 1m20s
Golang lint / lint (push) Successful in 4m8s

(fix): runtime reliability
(tests): regression coverage
(doc): v1.1 release notes
This commit is contained in:
2026-08-12 16:34:44 +03:00
parent 48ddf66540
commit f03a081ed6
83 changed files with 6122 additions and 1925 deletions
+29
View File
@@ -73,6 +73,35 @@ func TestInlineKeyboardButtonBuilderSetCallbackDataUsesConfiguredPayloadType(t *
}
}
func TestInlineKeyboardButtonBuilderKeepsExactlyOneAction(t *testing.T) {
callback := NewInlineKeyboardButton("Action").
SetURL("https://example.test").
SetCallbackDataJSON("confirm").
build()
if callback.URL != "" || callback.CallbackData == "" {
t.Fatalf("callback action was not exclusive: %#v", callback)
}
link := NewInlineKeyboardButton("Action").
SetCallbackDataJSON("confirm").
SetURL("https://example.test").
build()
if link.URL == "" || link.CallbackData != "" {
t.Fatalf("URL action was not exclusive: %#v", link)
}
}
func TestInlineKeyboardGetReturnsIndependentMarkup(t *testing.T) {
keyboard := NewInlineKeyboardJSON(1).AddURLButton("Docs", "https://example.test")
first := keyboard.Get()
first.InlineKeyboard[0][0].Text = "mutated"
second := keyboard.Get()
if got := second.InlineKeyboard[0][0].Text; got != "Docs" {
t.Fatalf("Get exposed builder state for mutation: got %q", got)
}
}
func TestInlineKeyboardGetPayloadTypeReturnsLocalOverride(t *testing.T) {
kb := NewInlineKeyboardJSON(2)
if got := kb.GetPayloadType(); got != BotPayloadJSON {