aboutsummaryrefslogtreecommitdiff
path: root/telegram/formatter/formatter_test.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2022-03-11 20:54:03 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2022-03-11 20:54:03 +0300
commit5514bc9d16ae4f6c4d26cb66945a5027b93ebcfe (patch)
treea3ee46f2e783e8dabcc9da63a2fd253827d047ac /telegram/formatter/formatter_test.go
parentcdbd960ff4337e2ee3bab877958c99ce6d63958d (diff)
Add strikethrough formatting
Diffstat (limited to 'telegram/formatter/formatter_test.go')
-rw-r--r--telegram/formatter/formatter_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/telegram/formatter/formatter_test.go b/telegram/formatter/formatter_test.go
index 5e3cdf0..c988b10 100644
--- a/telegram/formatter/formatter_test.go
+++ b/telegram/formatter/formatter_test.go
@@ -366,3 +366,29 @@ func TestFormattingXEP0393InlineCode(t *testing.T) {
t.Errorf("Wrong intersecting formatting: %v", markup)
}
}
+
+func TestFormattingMarkdownStrikethrough(t *testing.T) {
+ markup := Format("Everyone dislikes cake.", []*client.TextEntity{
+ &client.TextEntity{
+ Offset: 9,
+ Length: 3,
+ Type: &client.TextEntityTypeStrikethrough{},
+ },
+ }, EntityToMarkdown)
+ if markup != "Everyone ~~dis~~likes cake." {
+ t.Errorf("Wrong strikethrough formatting: %v", markup)
+ }
+}
+
+func TestFormattingXEP0393Strikethrough(t *testing.T) {
+ markup := Format("Everyone dislikes cake.", []*client.TextEntity{
+ &client.TextEntity{
+ Offset: 9,
+ Length: 3,
+ Type: &client.TextEntityTypeStrikethrough{},
+ },
+ }, EntityToXEP0393)
+ if markup != "Everyone ~dis~likes cake." {
+ t.Errorf("Wrong strikethrough formatting: %v", markup)
+ }
+}