summaryrefslogtreecommitdiffstats
path: root/model/utils_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/utils_test.go')
-rw-r--r--model/utils_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/model/utils_test.go b/model/utils_test.go
index aab535fc9..24ee4b7a6 100644
--- a/model/utils_test.go
+++ b/model/utils_test.go
@@ -81,3 +81,27 @@ func TestEtag(t *testing.T) {
t.Fatal()
}
}
+
+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",
+}
+
+func TestParseHashtags(t *testing.T) {
+ for input, output := range hashtags {
+ if o, _ := ParseHashtags(input); o != output {
+ t.Fatal("expected=" + output + " actual=" + o)
+ }
+ }
+}