From 94584a13435c8e04fa6ff3b582b13279addd6973 Mon Sep 17 00:00:00 2001 From: Nicolai Bach Woller Date: Mon, 14 Oct 2024 13:58:42 +0200 Subject: [PATCH] Fix. Ensure license plate validity. --- lib/locales/da-DK.yml | 2 +- test/test_da_dk_locale.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/locales/da-DK.yml b/lib/locales/da-DK.yml index 8223d7c9c6..e983afd407 100644 --- a/lib/locales/da-DK.yml +++ b/lib/locales/da-DK.yml @@ -566,4 +566,4 @@ da-DK: - Ur - Pung vehicle: - license_plate: '[A-Z]{2}\d{5}' + license_plate: '[A-F]{2}\d{5}' diff --git a/test/test_da_dk_locale.rb b/test/test_da_dk_locale.rb index ae52bc580d..fe97ff4a6b 100644 --- a/test/test_da_dk_locale.rb +++ b/test/test_da_dk_locale.rb @@ -62,6 +62,6 @@ def test_da_dk_counrty_code end def test_da_dk_license_plate - assert_match(/^[A-Z]{2}\d{5}$/, Faker::Vehicle.license_plate) + assert_match(/^(O[A-HJ-NPR-Z](?![BHBUCCCDDKDUEUKZMUYPSSUDUNVC])|[A-HJ-NPR-Z]{2})(\d{2,5})$/, Faker::Vehicle.license_plate) end end