3 changed files with 40 additions and 4 deletions
@ -0,0 +1,16 @@ |
|||||||
|
package utils |
||||||
|
|
||||||
|
import "testing" |
||||||
|
|
||||||
|
func TestUserAgent(t *testing.T) { |
||||||
|
testAgents := []string{ |
||||||
|
"Pleroma 1.0.0-1168-ge18c7866-pleroma-dot-site; https://pleroma.site info@pleroma.site", |
||||||
|
"Mastodon 1.2.3 Bot", |
||||||
|
} |
||||||
|
|
||||||
|
for _, agent := range testAgents { |
||||||
|
if !IsUserAgentABot(agent) { |
||||||
|
t.Error("Incorrect parsing of useragent", agent) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue