mirror of
				https://github.com/owncast/owncast.git
				synced 2025-11-04 13:27:21 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			340 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			340 B
		
	
	
	
		
			Go
		
	
	
	
	
	
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)
 | 
						|
		}
 | 
						|
	}
 | 
						|
}
 |