FILE / ScuroNeko/Laniakea

tgmd/utils_test.go

Исходный файл и его история в репозитории.
FILE 071fc2375e8d4560daca841c57664f0dadc78450
Files
Laniakea/tgmd/utils_test.go
T
ScuroNeko 071fc2375e
Golang lint / lint (push) Successful in 4m51s
(draft): telegram markdown v2 string builder
2026-04-30 13:56:36 +03:00

25 lines
627 B
Go

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)
}
})
}
}