-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
da-DK license plates #3010
base: main
Are you sure you want to change the base?
da-DK license plates #3010
Conversation
@@ -60,4 +60,8 @@ def test_da_dk_counrty_code | |||
assert_match(/(\+45)[\s](\d\d[\s-]?){4}$/, Faker::PhoneNumber.phone_number_with_country_code) | |||
assert_match(/(\+45)[\s](\d\d[\s-]?){4}$/, Faker::PhoneNumber.cell_phone_with_country_code) | |||
end | |||
|
|||
def test_da_dk_license_plate | |||
assert_match(/^(O[A-HJ-NPR-Z](?![BHBUCCCDDKDUEUKZMUYPSSUDUNVC])|[A-HJ-NPR-Z]{2})(\d{2,5})$/, Faker::Vehicle.license_plate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks too convoluted. What do you think of taking doing something like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it is convoluted, but I think your suggestion got cut off - unless you want to really simplify it 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, my bad! Changing computers mess up with my keyboard shortcuts 🙈
I meant something like:
assert_match(/^[A-Z]{2}-[0-9]{5}/, Faker::Vehicle.license_plate)
Could you also add screenshots of using this in the console ( |
Co-authored-by: Stefanni Brasil <[email protected]>
Motivation / Background
This Pull Request has been created because it was not possible to generate valid Danish license plates. It adds the simplest possible license plates consisting of 2 letters and 5 digits. It follows the rules laid out on the Danish Wikipedia.
Additional information
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
If you're proposing a new generator or locale: