File tree 2 files changed +2
-2
lines changed
main/kotlin/br/com/colman/simplecpfvalidator
test/kotlin/br/com/colman/simplecpfvalidator
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ import kotlin.math.abs
39
39
fun String.isCpf (charactersToIgnore : List <Char > = listOf('.', '-')): Boolean {
40
40
val cleanCpf = this .filterNot { it in charactersToIgnore }
41
41
if (cleanCpf.containsInvalidCPFChars() || cleanCpf.isInvalidCpfSize() || cleanCpf.isBlacklistedCpf()) return false
42
- return this .hasValidVerificationDigits()
42
+ return cleanCpf .hasValidVerificationDigits()
43
43
}
44
44
45
45
/* *
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class CpfValidatorTest : FunSpec({
43
43
}
44
44
45
45
test("Should sanitize the String given replaceable characters and still return true on valid cpfs") {
46
- ValidCpfGenerator .map { " $it ..--." }.forAll { cpf -> cpf.isCpf(listOf('.', '-')) }
46
+ ValidCpfGenerator .map { " ..--. $it ..--." }.forAll { cpf -> cpf.isCpf(listOf('.', '-')) }
47
47
}
48
48
49
49
test("Shouldn 't sanitize unspecified characters") {
You can’t perform that action at this time.
0 commit comments