github.com/Johnny2210/revive@v1.0.8-0.20210625134200-febf37ccd0f5/test/import-blacklist_test.go (about)

     1  package test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/mgechev/revive/lint"
     7  	"github.com/mgechev/revive/rule"
     8  )
     9  
    10  func TestImportsBlacklist(t *testing.T) {
    11  	args := []interface{}{"crypto/md5", "crypto/sha1"}
    12  
    13  	testRule(t, "imports-blacklist", &rule.ImportsBlacklistRule{}, &lint.RuleConfig{
    14  		Arguments: args,
    15  	})
    16  }
    17  
    18  func BenchmarkImportsBlacklist(b *testing.B) {
    19  	args := []interface{}{"crypto/md5", "crypto/sha1"}
    20  	var t *testing.T
    21  	for i := 0; i <= b.N; i++ {
    22  		testRule(t, "imports-blacklist", &rule.ImportsBlacklistRule{}, &lint.RuleConfig{
    23  			Arguments: args,
    24  		})
    25  	}
    26  }