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

     1  package cpfcnpj
     2  
     3  import "testing"
     4  
     5  func TestValidarCPF(t *testing.T) {
     6  	for _, cpf := range []string{"999.300.510-07", "982.714.570-39", "666.204.260-93", "306.052.520-09"} {
     7  		if ValidateCPF(cpf) != true {
     8  			t.Errorf("Validação errada de cpf válido %s", cpf)
     9  		}
    10  	}
    11  }
    12  
    13  func BenchmarkValidarCPF(*testing.B) {
    14  	for _, cpf := range []string{"999.300.510-07", "982.714.570-39", "666.204.260-93", "306.052.520-09"} {
    15  		ValidateCPF(cpf)
    16  	}
    17  }