diff options
Diffstat (limited to 'telegram/formatter/formatter_test.go')
-rw-r--r-- | telegram/formatter/formatter_test.go | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/telegram/formatter/formatter_test.go b/telegram/formatter/formatter_test.go index 5ac6262..5e3cdf0 100644 --- a/telegram/formatter/formatter_test.go +++ b/telegram/formatter/formatter_test.go @@ -64,7 +64,7 @@ func TestFormattingAdjacentAndNested(t *testing.T) { Type: &client.TextEntityTypeItalic{}, }, }, EntityToMarkdown) - if markup != "\n```\n**👙**🐧\n```\n_🐖_" { + if markup != "```\n**👙**🐧\n```_🐖_" { t.Errorf("Wrong adjacent&nested formatting: %v", markup) } } @@ -265,7 +265,7 @@ func TestFormattingXEP0393AdjacentAndNested(t *testing.T) { Type: &client.TextEntityTypeItalic{}, }, }, EntityToXEP0393) - if markup != "\n```\n*👙*🐧\n```\n_🐖_" { + if markup != "```\n*👙*🐧\n```_🐖_" { t.Errorf("Wrong adjacent&nested formatting: %v", markup) } } @@ -348,3 +348,21 @@ func TestFormattingXEP0393Intersecting(t *testing.T) { t.Errorf("Wrong intersecting formatting: %v", markup) } } + +func TestFormattingXEP0393InlineCode(t *testing.T) { + markup := Format("Is Gajim a thing?\n\necho 'Hello'\necho 'world'\n\nhruck(", []*client.TextEntity{ + &client.TextEntity{ + Offset: 3, + Length: 5, + Type: &client.TextEntityTypeCode{}, + }, + &client.TextEntity{ + Offset: 19, + Length: 25, + Type: &client.TextEntityTypePre{}, + }, + }, EntityToXEP0393) + if markup != "Is `Gajim` a thing?\n\n```\necho 'Hello'\necho 'world'\n```\n\nhruck(" { + t.Errorf("Wrong intersecting formatting: %v", markup) + } +} |