github.com/go-email-validator/go-email-validator@v0.0.0-20230409163946-b8b9e6a0552e/pkg/presentation/mailboxvalidator/score_test.go (about)

     1  package mailboxvalidator
     2  
     3  import (
     4  	"github.com/emirpasic/gods/sets/hashset"
     5  	"testing"
     6  )
     7  
     8  func TestCalculateScore(t *testing.T) {
     9  	skipEmail := hashset.New(
    10  		"zxczxczxc@joycasinoru", //TODO syntax is valid
    11  	)
    12  
    13  	tests := detPresenters(t)
    14  
    15  	for _, tt := range tests {
    16  		if skipEmail.Contains(tt.EmailAddress) {
    17  			t.Logf("skipped %v", tt.EmailAddress)
    18  			continue
    19  		}
    20  
    21  		t.Run(tt.EmailAddress, func(t *testing.T) {
    22  			if got := CalculateScore(tt); got != tt.MailboxvalidatorScore {
    23  				t.Errorf("CalculateScore() = %v, want %v", got, tt.MailboxvalidatorScore)
    24  			}
    25  		})
    26  	}
    27  }