diff options
Diffstat (limited to 'utils/utils_test.go')
-rw-r--r-- | utils/utils_test.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/utils/utils_test.go b/utils/utils_test.go index ababc083a..ea41f48f6 100644 --- a/utils/utils_test.go +++ b/utils/utils_test.go @@ -1,6 +1,8 @@ package utils -import "testing" +import ( + "testing" +) func TestUserAgent(t *testing.T) { testAgents := []string{ @@ -16,3 +18,15 @@ func TestUserAgent(t *testing.T) { } } } + +func TestGetHashtagsFromText(t *testing.T) { + text := `Some text with a #hashtag goes here.\n\n + Another #secondhashtag, goes here.\n\n + #thirdhashtag` + + hashtags := GetHashtagsFromText(text) + + if hashtags[0] != "#hashtag" || hashtags[1] != "#secondhashtag" || hashtags[2] != "#thirdhashtag" { + t.Error("Incorrect hashtags fetched from text.") + } +} |