aboutsummaryrefslogtreecommitdiff
path: root/telegram/formatter/formatter_test.go
diff options
context:
space:
mode:
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)
+ }
+}