From 97ede2a428faf3a62ce0140e51ed591e261c09a1 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Mon, 25 Jan 2016 16:47:49 -0500 Subject: Updated serverside hashtag regex to ignore more punctuation around words --- model/utils_test.go | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) (limited to 'model/utils_test.go') diff --git a/model/utils_test.go b/model/utils_test.go index 24ee4b7a6..b8eabe264 100644 --- a/model/utils_test.go +++ b/model/utils_test.go @@ -83,19 +83,34 @@ func TestEtag(t *testing.T) { } var hashtags map[string]string = map[string]string{ - "#test": "#test", - "test": "", - "#test123": "#test123", - "#123test123": "", - "#test-test": "#test-test", - "#test?": "#test", - "hi #there": "#there", - "#bug #idea": "#bug #idea", - "#bug or #gif!": "#bug #gif", - "#hüllo": "#hüllo", - "#?test": "", - "#-test": "", - "#yo_yo": "#yo_yo", + "#test": "#test", + "test": "", + "#test123": "#test123", + "#123test123": "", + "#test-test": "#test-test", + "#test?": "#test", + "hi #there": "#there", + "#bug #idea": "#bug #idea", + "#bug or #gif!": "#bug #gif", + "#hüllo": "#hüllo", + "#?test": "", + "#-test": "", + "#yo_yo": "#yo_yo", + "(#brakets)": "#brakets", + ")#stekarb(": "#stekarb", + "<#less_than<": "#less_than", + ">#greater_than>": "#greater_than", + "-#minus-": "#minus", + "+#plus+": "#plus", + "=#equals=": "#equals", + "%#pct%": "#pct", + "&#and&": "#and", + "^#hat^": "#hat", + "##brown#": "#brown", + "*#star*": "#star", + "|#pipe|": "#pipe", + ":#colon:": "#colon", + ";#semi;": "#semi", } func TestParseHashtags(t *testing.T) { -- cgit v1.2.3-1-g7c22