Skip to content

Commit

Permalink
Brazil passport number
Browse files Browse the repository at this point in the history
  • Loading branch information
badoken authored and kingthorin committed Nov 10, 2024
1 parent fde98f0 commit cd7e58d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/resources/pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -723,3 +723,6 @@ pt-BR:
"Taiwaneses", "Tanzanianos", "Tailandeses", "Tibetanos", "Trinitinos", "Tobagonianos", "Tunisianos", "Turcos", "Tuvaluenses",
"Ugandenses", "Ucranianos", "Uruguaios", "Uzbeques", "Vanuatuenses", "Venezuelanos", "Vietnamitas", "Galeses", "Iemenitas",
"Zambianos", "Zimbabuanos"]

passport:
valid: "[A-Z]{2}[0-9]{6}"
7 changes: 7 additions & 0 deletions src/test/java/net/datafaker/providers/base/PassportTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,11 @@ void testValidFinland() {
.hasSize(9);
}

@RepeatedTest(10)
void testValidBrazil() {
assertThat(new BaseFaker(new Locale("pt", "BR")).passport().valid())
.hasSize(8)
.matches("[A-Z]{2}[0-9]{6}");
}

}

0 comments on commit cd7e58d

Please sign in to comment.