github.com/flaviomilan/go-cpfcnpj@v0.0.0-20210611041328-ef38adcb4e52/cpfcnpj/cnpj_test.go (about)

     1  package cpfcnpj
     2  
     3  import "testing"
     4  
     5  func TestValidarCNPJ(t *testing.T) {
     6  	for _, cnpj := range []string{"34.948.284/0001-64", "55.085.855/0001-54"} {
     7  		if ValidateCNPJ(cnpj) != true {
     8  			t.Errorf("Validação errada de cnpj válido %s", cnpj)
     9  		}
    10  	}
    11  }
    12  
    13  func BenchmarkValidarCNPJ(*testing.B) {
    14  	for _, cnpj := range []string{"34.948.284/0001-64", "55.085.855/0001-54"} {
    15  		ValidateCNPJ(cnpj)
    16  	}
    17  }