summaryrefslogtreecommitdiffstats
path: root/app/notification_test.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-09-04 09:31:20 -0400
committerSaturnino Abril <saturnino.abril@gmail.com>2017-09-04 21:31:20 +0800
commit98bb4c31a1eca362e6052075b12fa2dc5ab2a47d (patch)
tree2247efb50cec547351d3a93fb815223ce1a0b370 /app/notification_test.go
parentc8d51b64656383c294339b2a2b353f48e07f8b03 (diff)
downloadchat-98bb4c31a1eca362e6052075b12fa2dc5ab2a47d.tar.gz
chat-98bb4c31a1eca362e6052075b12fa2dc5ab2a47d.tar.bz2
chat-98bb4c31a1eca362e6052075b12fa2dc5ab2a47d.zip
PLT-7473 Ignore text surrounded by multiple backquotes when parsing mentions (#7347)
Diffstat (limited to 'app/notification_test.go')
-rw-r--r--app/notification_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/notification_test.go b/app/notification_test.go
index ae6d0504a..02b6e1db0 100644
--- a/app/notification_test.go
+++ b/app/notification_test.go
@@ -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) {