(draft): telegram markdown v2 string builder
Golang lint / lint (push) Successful in 4m51s

This commit is contained in:
2026-04-30 13:56:36 +03:00
parent 269ccec007
commit 071fc2375e
34 changed files with 1227 additions and 385 deletions
+24
View File
@@ -0,0 +1,24 @@
package tgmd
import "testing"
func TestFormattingHelpers(t *testing.T) {
tests := []struct {
name string
got string
want string
}{
{name: "bold", got: WithBold("text"), want: "*text*"},
{name: "italic", got: WithItalic("text"), want: "_text_"},
{name: "inline code", got: WithInlineCode("text"), want: "`text`"},
{name: "link", got: WithLink("Laniakea", "https://example.test"), want: "[Laniakea](https://example.test)"},
}
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
if tc.got != tc.want {
t.Fatalf("unexpected formatted text: got %q want %q", tc.got, tc.want)
}
})
}
}