PLT-7473 Ignore text surrounded by multiple backquotes when parsing mentions (#7347)

Этот коммит содержится в:
Harrison Healey
2017-09-04 09:31:20 -04:00
коммит произвёл Saturnino Abril
родитель c8d51b6465
Коммит 98bb4c31a1
2 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@@ -382,7 +382,7 @@ func TestRemoveCodeFromMessage(t *testing.T) {
t.Fatalf("received incorrect output\n\nGot:\n%v\n\nExpected:\n%v\n", actual, expected)
}
input = "this is `not\n \ncode` because it has line with only whitespace"
input = "this is `not\n \ncode` because it has a line with only whitespace"
expected = input
if actual := removeCodeFromMessage(input); actual != expected {
t.Fatalf("received incorrect output\n\nGot:\n%v\n\nExpected:\n%v\n", actual, expected)
@@ -393,6 +393,12 @@ func TestRemoveCodeFromMessage(t *testing.T) {
if actual := removeCodeFromMessage(input); actual != expected {
t.Fatalf("received incorrect output\n\nGot:\n%v\n\nExpected:\n%v\n", actual, expected)
}
input = "these are ``multiple backquotes`` around code"
expected = "these are around code"
if actual := removeCodeFromMessage(input); actual != expected {
t.Fatalf("received incorrect output\n\nGot:\n%v\n\nExpected:\n%v\n", actual, expected)
}
}
func TestGetMentionKeywords(t *testing.T) {