Skip to content

Commit

Permalink
Merge pull request #32 from williamgueiros/remove-basic-validation
Browse files Browse the repository at this point in the history
Remove validação de numeros básicos
  • Loading branch information
VitorTrin authored Mar 18, 2021
2 parents 126fb7d + 558ebfc commit 1ddbd8c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 27 deletions.
14 changes: 0 additions & 14 deletions lib/cpfcnpj.ex
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,7 @@ defmodule Cpfcnpj do

basic = String.slice(cnpj, 0..7)

not_allowed_basics = basic in ~w<
11111111
22222222
33333333
44444444
55555555
66666666
77777777
88888888
99999999 >

cond do
not_allowed_basics ->
false

order == "0000" ->
false

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Brcpfcnpj.Mixfile do
def project do
[
app: :brcpfcnpj,
version: "0.2.3",
version: "0.2.4",
elixir: "~> 1.7",
description: description(),
package: package(),
Expand Down
12 changes: 0 additions & 12 deletions test/cnpj_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,4 @@ defmodule CnpjTest do
assert Brcpfcnpj.cnpj_valid?(%Cnpj{number: "00000898246954"}) == false
assert Brcpfcnpj.cnpj_valid?(%Cnpj{number: "00000136747140"}) == false
end

test "should be invalid for basic orders" do
assert Brcpfcnpj.cnpj_valid?(%Cnpj{number: "11111111030180"}) == false
assert Brcpfcnpj.cnpj_valid?(%Cnpj{number: "22222222030180"}) == false
assert Brcpfcnpj.cnpj_valid?(%Cnpj{number: "33333333030180"}) == false
assert Brcpfcnpj.cnpj_valid?(%Cnpj{number: "44444444030180"}) == false
assert Brcpfcnpj.cnpj_valid?(%Cnpj{number: "55555555030180"}) == false
assert Brcpfcnpj.cnpj_valid?(%Cnpj{number: "66666666030180"}) == false
assert Brcpfcnpj.cnpj_valid?(%Cnpj{number: "77777777030180"}) == false
assert Brcpfcnpj.cnpj_valid?(%Cnpj{number: "88888888030180"}) == false
assert Brcpfcnpj.cnpj_valid?(%Cnpj{number: "99999999030180"}) == false
end
end

0 comments on commit 1ddbd8c

Please sign in to comment.