Skip to content

test(isTaxID): cover dk-DK century digits 5-8 years 37-58 - #2851

Closed
arronKler wants to merge 1 commit into
validatorjs:masterfrom
arronKler:fix/2818-dk-cpr-century
Closed

test(isTaxID): cover dk-DK century digits 5-8 years 37-58#2851
arronKler wants to merge 1 commit into
validatorjs:masterfrom
arronKler:fix/2818-dk-cpr-century

Conversation

@arronKler

Copy link
Copy Markdown

#2819 already corrected dkDkCheck so century digits 5-8 map years 00-57 to the 2000s and 58-99 to the 1800s (Danish CPR table: https://da.wikipedia.org/wiki/CPR-nummer, also https://blog.ploeh.dk/2018/12/10/danish-cpr-numbers-in-f/). The algorithm change did not add tests for the old 37-58 rejection gap, so #2818 stayed open.

This adds the checksum-valid examples from that issue (0101375005, 0101455009, 0101575004, 0101585018, plus the 36/59 boundaries) to the existing isTaxID dk-DK cases.

Fixes #2818

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)
  • References provided in PR (where applicable)

validatorjs#2819 already maps century digits 5-8 as years 00-57 → 2000s and
58-99 → 1800s, but the suite never asserted those years. Add the
checksum-valid CPR examples from validatorjs#2818 so the old 37-58 rejection
cannot return unnoticed.

Fixes validatorjs#2818
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (cdb7daf) to head (9838322).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2851   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2599      2599           
  Branches       658       658           
=========================================
  Hits          2599      2599           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@arronKler

Copy link
Copy Markdown
Author

Closing this as superseded by #2819, which already landed and closed the algorithm gap for #2818. The extra tests can be revived later if maintainers want them independently.

@arronKler arronKler closed this Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isTaxID(dk-DK): valid CPR numbers wrongly rejected for century-digit 5-8, year 37-58

1 participant