File size: 364 Bytes
ca7217f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | package random
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestUserAgent(t *testing.T) {
// We should have at least 100 User-Agent(s).
assert.Greater(t, len(_userAgents), 100)
for _, ua := range _userAgents {
assert.NotEmpty(t, ua.Raw)
assert.True(t, filter(ua))
}
for i := 0; i < 1e2; i++ {
assert.NotEmpty(t, UserAgent())
}
}
|