Fix tests and linters
This commit is contained in:
@@ -3,6 +3,8 @@ package dga
|
||||
import "testing"
|
||||
|
||||
func TestLmsScoreOfDomain(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testDomain(t, "g.symcd.com.", 100, 100)
|
||||
testDomain(t, "www.google.com.", 100, 100)
|
||||
testDomain(t, "55ttt5.12abc3.test.com.", 68, 69)
|
||||
@@ -10,6 +12,8 @@ func TestLmsScoreOfDomain(t *testing.T) {
|
||||
}
|
||||
|
||||
func testDomain(t *testing.T, domain string, min, max float64) {
|
||||
t.Helper()
|
||||
|
||||
score := LmsScoreOfDomain(domain)
|
||||
if score < min || score > max {
|
||||
t.Errorf("domain %s has scored %.2f, but should be between %.0f and %.0f", domain, score, min, max)
|
||||
|
||||
Reference in New Issue
Block a user